Fix CollabTable brand color not applying outside the app shell
Lint / Lint (push) Successful in 26s
Tests / Go backend (push) Successful in 32s
Tests / Dashboard checks (push) Successful in 49s
Docker / Docker Build & Push (push) Successful in 3m14s

The shared component library's --sc-primary/--sc-accent/--sc-ring tokens
were only remapped onto CollabTable's own brand color inside AppShell's
.collabtable-shell scope, so anything rendered outside it (the login/setup
AuthPage, the Settings/Profile dialogs) fell back to the shared library's
generic default blue instead of this project's own blue brand. Move that
bridge to app.css so it applies globally, with high-specificity `html`
selectors so it reliably wins over shared-styles.css regardless of import
order.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Gabriel20xxandClaude Sonnet 5 committed 2026-09-11 11:24:56 +02:00
1 parent fc4400b118
commit df94fc6d8b
2 files changed
+31 -27

No files matched your search

+25
View File
@@ -30,6 +30,21 @@
color-scheme: dark; color-scheme: dark;
} }
/* Bridge onto the shared component library's own --sc-* tokens so parts of the app built from
@gabriel20xx/web-ui components outside AppShell's .collabtable-shell scope (AuthPage, the
Settings/Profile dialogs) carry this project's brand color too, instead of falling back to the
shared library's generic default blue. `html` raises specificity above shared-styles.css's
plain `:root`/`[data-theme]` rules so this wins regardless of stylesheet import order. */
html:root,
html[data-theme='dark'] {
--sc-primary: var(--color-primary);
--sc-primary-hover: var(--color-secondary);
--sc-primary-fg: var(--color-primary-fg);
--sc-accent: var(--color-accent);
--sc-accent-fg: var(--color-accent-fg);
--sc-ring: var(--color-ring);
}
[data-theme='light'] { [data-theme='light'] {
--color-bg: var(--sc-bg); --color-bg: var(--sc-bg);
--color-surface: var(--sc-surface); --color-surface: var(--sc-surface);
@@ -53,6 +68,16 @@
color-scheme: light; color-scheme: light;
} }
/* See the dark-theme bridge above for why this exists and why `html` is needed. */
html[data-theme='light'] {
--sc-primary: var(--color-primary);
--sc-primary-hover: var(--color-secondary);
--sc-primary-fg: var(--color-primary-fg);
--sc-accent: var(--color-accent);
--sc-accent-fg: var(--color-accent-fg);
--sc-ring: var(--color-ring);
}
@theme inline { @theme inline {
--color-bg: var(--color-bg); --color-bg: var(--color-bg);
--color-surface: var(--color-surface); --color-surface: var(--color-surface);
@@ -68,36 +68,15 @@
/> />
<style> <style>
/* The shared component library (header, page title box, dialogs, buttons, ...) otherwise /* Most --sc-* bridging (primary/accent/ring, and the shared background/surface/border/status
renders in its own generic default palette instead of this app's own branding - remap its tokens) now lives globally in app.css so it also reaches shared components rendered outside
--sc-* tokens onto this app's own --color-* palette so every shared component follows suit. this scope (AuthPage, the Settings/Profile dialogs). --sc-secondary is a subtle tinted-surface
--sc-secondary is a subtle tinted-surface color for low-emphasis buttons, a different role color for low-emphasis buttons here, a different role than this app's own saturated
than this app's own saturated --color-secondary, so it's derived instead of mapped directly. */ --color-secondary, so it stays local rather than overriding --color-secondary's shared
meaning workspace-wide. */
:global(.collabtable-shell) { :global(.collabtable-shell) {
--sc-bg: var(--color-bg);
--sc-surface: var(--color-surface);
--sc-surface-raised: var(--color-surface);
--sc-surface-hover: var(--color-surface-hover);
--sc-border: var(--color-border);
--sc-border-strong: var(--color-border);
--sc-fg: var(--color-fg);
--sc-muted-fg: var(--color-muted-fg);
--sc-subtle-fg: var(--color-muted-fg);
--sc-primary: var(--color-primary);
--sc-primary-hover: var(--color-secondary);
--sc-primary-fg: var(--color-primary-fg);
--sc-secondary: color-mix(in srgb, var(--color-primary) 12%, var(--color-surface)); --sc-secondary: color-mix(in srgb, var(--color-primary) 12%, var(--color-surface));
--sc-secondary-hover: color-mix(in srgb, var(--color-primary) 20%, var(--color-surface)); --sc-secondary-hover: color-mix(in srgb, var(--color-primary) 20%, var(--color-surface));
--sc-secondary-fg: var(--color-fg); --sc-secondary-fg: var(--color-fg);
--sc-accent: var(--color-accent);
--sc-accent-fg: var(--color-accent-fg);
--sc-danger: var(--color-danger);
--sc-danger-hover: color-mix(in srgb, var(--color-danger) 90%, black);
--sc-danger-fg: var(--color-danger-fg);
--sc-success: var(--color-success);
--sc-success-fg: var(--color-success-fg);
--sc-warning: var(--color-warning);
--sc-warning-fg: var(--color-warning-fg);
--sc-ring: var(--color-ring);
} }
</style> </style>