From 92fdf04e641ea46fe35c8f1e97cb21d1cda72709 Mon Sep 17 00:00:00 2001 From: g-but <41178744+g-but@users.noreply.github.com> Date: Sat, 25 Apr 2026 16:34:30 +0200 Subject: [PATCH] refactor(theme): replace hardcoded modal/drawer hex with CSS tokens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CLAUDE.md is explicit: 'Use shadcn theme tokens — never hardcode hex'. The modal/drawer surface colors #0f1117 and #0c0e14 were duplicated across 10 files, violating SSOT. - globals.css: add --surface-modal / --surface-drawer custom properties in :root and .dark, register as Tailwind colors via @theme inline - 10 components: bg-[#0f1117] → bg-surface-modal, bg-[#0c0e14] → bg-surface-drawer A future palette tweak now changes 1 file, not 10. Verified bg-surface-{modal,drawer} classes are present in the prod CSS. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/app/globals.css | 6 ++++++ src/components/goals/NewGoalButton.tsx | 2 +- src/components/money/NewSubscriptionButton.tsx | 2 +- src/components/people/NewPersonButton.tsx | 2 +- src/components/projects/NewProjectButton.tsx | 2 +- src/components/projects/ProjectDetail.tsx | 2 +- src/components/projects/ProjectDetailHeader.tsx | 2 +- src/components/prompts/RunModal.tsx | 2 +- src/components/prompts/ScheduleModal.tsx | 2 +- src/components/shell/AskIvyModal.tsx | 2 +- src/components/system/JobDetail.tsx | 4 ++-- 11 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index 783b220b2..b9e820f03 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -39,6 +39,8 @@ --color-popover: var(--popover); --color-card-foreground: var(--card-foreground); --color-card: var(--card); + --color-surface-modal: var(--surface-modal); + --color-surface-drawer: var(--surface-drawer); --radius-sm: calc(var(--radius) * 0.6); --radius-md: calc(var(--radius) * 0.8); --radius-lg: var(--radius); @@ -81,6 +83,8 @@ --sidebar-accent-foreground: oklch(0.205 0 0); --sidebar-border: oklch(0.922 0 0); --sidebar-ring: oklch(0.708 0 0); + --surface-modal: #0f1117; + --surface-drawer: #0c0e14; } .dark { @@ -115,6 +119,8 @@ --sidebar-accent-foreground: oklch(0.985 0 0); --sidebar-border: oklch(1 0 0 / 10%); --sidebar-ring: oklch(0.556 0 0); + --surface-modal: #0f1117; + --surface-drawer: #0c0e14; } @layer base { diff --git a/src/components/goals/NewGoalButton.tsx b/src/components/goals/NewGoalButton.tsx index 0c6983bc9..61e7c2509 100644 --- a/src/components/goals/NewGoalButton.tsx +++ b/src/components/goals/NewGoalButton.tsx @@ -74,7 +74,7 @@ export function NewGoalButton({ goals }: { goals: GoalWithChildren[] }) { {open && (
-
+
New Goal