From 88c91e22b00753060c4200bbe10d7638f0dbd6b2 Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Sat, 13 Dec 2025 14:40:16 +0100 Subject: [PATCH] fix(ui): replace hardcoded colors with theme variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - InputBar: use --color-primary, --color-surface, --color-border for focus ring, backgrounds, and syntax highlighting - PillToolbarButton: active state uses --color-primary - PillViewSwitcher: sliding indicator and active text use theme colors - PillTimeRangeSelector: all glass effects and active states themed - CalendarToolbar: FAB active state uses theme colors - CalendarToolbarContent: removed hardcoded primaryColor prop - DateStrip: replaced all #3b82f6 with theme variables All UI components now automatically adapt to the selected theme (Ocean, Sunset, Forest, etc.) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../calendar/CalendarToolbar.svelte | 38 ++---- .../calendar/CalendarToolbarContent.svelte | 16 +-- .../lib/components/calendar/DateStrip.svelte | 84 ++++++++---- .../navigation/PillTimeRangeSelector.svelte | 124 ++++-------------- .../src/navigation/PillToolbarButton.svelte | 16 +-- .../src/navigation/PillViewSwitcher.svelte | 45 ++----- .../shared-ui/src/quick-input/InputBar.svelte | 64 ++++----- 7 files changed, 140 insertions(+), 247 deletions(-) diff --git a/apps/calendar/apps/web/src/lib/components/calendar/CalendarToolbar.svelte b/apps/calendar/apps/web/src/lib/components/calendar/CalendarToolbar.svelte index 5ff5d7412..4799fa658 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/CalendarToolbar.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/CalendarToolbar.svelte @@ -146,11 +146,11 @@ align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; - background: rgba(255, 255, 255, 0.92); + background: hsl(var(--color-surface) / 0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); - border: 1px solid rgba(0, 0, 0, 0.1); - box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08); + border: 1px solid hsl(var(--color-border)); + box-shadow: 0 -2px 16px hsl(var(--color-foreground) / 0.08); border-radius: 1rem; white-space: nowrap; max-width: calc(100vw - 2rem); @@ -164,26 +164,16 @@ display: none; /* Chrome/Safari */ } - :global(.dark) .toolbar-content { - background: rgba(30, 30, 30, 0.92); - border: 1px solid rgba(255, 255, 255, 0.15); - } - /* Glass styling */ .glass-pill { - background: rgba(255, 255, 255, 0.85); + background: hsl(var(--color-surface) / 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); - border: 1px solid rgba(0, 0, 0, 0.1); - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); + border: 1px solid hsl(var(--color-border)); + box-shadow: 0 2px 8px hsl(var(--color-foreground) / 0.08); border-radius: 9999px; } - :global(.dark) .glass-pill { - background: rgba(255, 255, 255, 0.12); - border: 1px solid rgba(255, 255, 255, 0.15); - } - .glass-panel { background: transparent; } @@ -203,19 +193,15 @@ .toolbar-fab:hover { transform: scale(1.05); - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + box-shadow: 0 4px 12px hsl(var(--color-foreground) / 0.15); } .toolbar-fab.active { - background: rgba(0, 0, 0, 0.05); - } - - :global(.dark) .toolbar-fab.active { - background: rgba(255, 255, 255, 0.15); + background: hsl(var(--color-muted)); } .toolbar-fab.active .fab-icon { - color: hsl(var(--color-muted-foreground)); + color: hsl(var(--color-primary)); } .fab-icon { @@ -232,14 +218,10 @@ .toolbar-divider { width: 1px; height: 1.5rem; - background: rgba(0, 0, 0, 0.1); + background: hsl(var(--color-border)); margin: 0 0.25rem; } - :global(.dark) .toolbar-divider { - background: rgba(255, 255, 255, 0.15); - } - /* Layout toggle button */ .layout-btn { display: flex; diff --git a/apps/calendar/apps/web/src/lib/components/calendar/CalendarToolbarContent.svelte b/apps/calendar/apps/web/src/lib/components/calendar/CalendarToolbarContent.svelte index d44f6fc0a..af591ef61 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/CalendarToolbarContent.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/CalendarToolbarContent.svelte @@ -101,7 +101,6 @@ options={viewOptions} value={viewStore.viewType} onChange={handleViewChange} - primaryColor="#3b82f6" embedded={true} /> @@ -155,21 +154,12 @@ } .toolbar-content.vertical :global(.pill-view-switcher .switcher-btn:hover) { - background: rgba(0, 0, 0, 0.05); - } - - :global(.dark) .toolbar-content.vertical :global(.pill-view-switcher .switcher-btn:hover) { - background: rgba(255, 255, 255, 0.1); + background: hsl(var(--color-foreground) / 0.05); } .toolbar-content.vertical :global(.pill-view-switcher .switcher-btn.active) { - background: color-mix(in srgb, #3b82f6 15%, transparent 85%); - border-color: color-mix(in srgb, #3b82f6 25%, transparent 75%); - } - - :global(.dark) .toolbar-content.vertical :global(.pill-view-switcher .switcher-btn.active) { - background: color-mix(in srgb, #3b82f6 25%, transparent 75%); - border-color: color-mix(in srgb, #3b82f6 35%, transparent 65%); + background: hsl(var(--color-primary) / 0.15); + border-color: hsl(var(--color-primary) / 0.25); } /* PillTimeRangeSelector in vertical mode */ diff --git a/apps/calendar/apps/web/src/lib/components/calendar/DateStrip.svelte b/apps/calendar/apps/web/src/lib/components/calendar/DateStrip.svelte index eff4b2f47..d1052e793 100644 --- a/apps/calendar/apps/web/src/lib/components/calendar/DateStrip.svelte +++ b/apps/calendar/apps/web/src/lib/components/calendar/DateStrip.svelte @@ -1,6 +1,8 @@