feat(shared): add centralized helper functions for templates

This commit is contained in:
2026-04-20 16:36:14 +02:00
parent 953e2a067e
commit 436686eed1
3 changed files with 66 additions and 0 deletions

10
web/shared/ui.go Normal file
View File

@@ -0,0 +1,10 @@
package shared
// TabClass returns the CSS class for watchlist filter tabs
func TabClass(active bool) string {
base := "shrink-0 whitespace-nowrap bg-(--panel-soft) px-2 py-1 text-xs text-(--text-muted) no-underline hover:bg-(--surface-tab-hover) hover:text-(--text) hover:no-underline"
if active {
return "shrink-0 whitespace-nowrap bg-(--surface-tab-active) px-2 py-1 text-xs text-(--accent) no-underline hover:no-underline"
}
return base
}