From df94fc6d8bd5658c66a9a9caedb7c141cb607393 Mon Sep 17 00:00:00 2001 From: Gabriel20xx Date: Fri, 11 Sep 2026 11:24:56 +0200 Subject: [PATCH] Fix CollabTable brand color not applying outside the app shell 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 --- frontend/src/app.css | 25 ++++++++++++++ .../src/lib/features/layout/AppShell.svelte | 33 ++++--------------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/frontend/src/app.css b/frontend/src/app.css index e91309b..238273e 100644 --- a/frontend/src/app.css +++ b/frontend/src/app.css @@ -30,6 +30,21 @@ 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'] { --color-bg: var(--sc-bg); --color-surface: var(--sc-surface); @@ -53,6 +68,16 @@ 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 { --color-bg: var(--color-bg); --color-surface: var(--color-surface); diff --git a/frontend/src/lib/features/layout/AppShell.svelte b/frontend/src/lib/features/layout/AppShell.svelte index ae68b72..4f41dec 100644 --- a/frontend/src/lib/features/layout/AppShell.svelte +++ b/frontend/src/lib/features/layout/AppShell.svelte @@ -68,36 +68,15 @@ />