diff --git a/.changeset/activate-shadcn-color-tokens.md b/.changeset/activate-shadcn-color-tokens.md new file mode 100644 index 0000000000..822bf3d66a --- /dev/null +++ b/.changeset/activate-shadcn-color-tokens.md @@ -0,0 +1,36 @@ +--- +'@accounter/client': patch +--- + +Activate the shadcn colour tokens, which have been compiling to nothing since the Tailwind v4 +migration. + +`components.json` declared `cssVariables: false` and pointed `tailwind.config.cjs` — a file that does +not exist anywhere in the monorepo. It was deleted during the v3 → v4 migration and the theme layer +was never ported to v4's CSS-first `@theme`, so `--color-card`, `--color-muted-foreground`, +`--color-destructive` and the rest were never registered and Tailwind never generated the utilities +that reference them. Roughly 380 usages across ~100 files were inert: `text-muted-foreground`, +`bg-card`, `border-border` and `text-destructive` each emitted **zero** rules into the bundle, so +secondary text rendered as full-strength body colour, `bg-muted`/`bg-accent`/`bg-card` were +transparent, and error text rendered black instead of red. + +`src/index.css` now defines the full token set in `@theme` on shadcn's `gray` base, with `.dark` +overrides in `@layer base`. Values are literal `oklch()` rather than `var(--color-gray-500)` +references, because Tailwind v4 only emits the default palette variables it sees used — referencing +one that happens to be unused elsewhere would resolve to nothing. Tokens that stood in for an +existing default were given that default's value, so classes which were previously no-ops stay +visually unchanged: `--color-background`/`--color-card` are white (already the page background), +`--color-foreground` is gray-950 (already the inherited text colour), and `--color-border` is gray-200 +to match the `border-color` compatibility rule already in the base layer. The visible changes are the +genuinely broken cases — muted text now reads gray-500, `text-destructive` reads red-600, and +`bg-muted`/`bg-accent`/`bg-secondary` gain their light tint. + +Also fixes `business/client/charts-section.tsx`, which set its axis ticks with +`hsl(var(--muted-foreground))`. That is v3 syntax: the v4 token is `--color-muted-foreground` and +holds a colour rather than an HSL triplet, so the `hsl()` wrapper produced an invalid value and the +ticks fell back to Recharts' default. Its `hsl(var(--chart-N))` siblings are correct and unchanged — +the `--chart-*` family really is stored as triplets. + +Dark mode remains inert: `next-themes` is installed but no `ThemeProvider` is mounted, so nothing ever +puts `.dark` on an ancestor. The overrides are defined so the ~425 `dark:` utilities already in the +codebase are correct when that switch is eventually wired. diff --git a/packages/client/components.json b/packages/client/components.json index d940d3dc99..55d11a924e 100644 --- a/packages/client/components.json +++ b/packages/client/components.json @@ -4,10 +4,10 @@ "rsc": false, "tsx": true, "tailwind": { - "config": "tailwind.config.cjs", + "config": "", "css": "src/index.css", "baseColor": "gray", - "cssVariables": false, + "cssVariables": true, "prefix": "" }, "aliases": { diff --git a/packages/client/src/components/business/client/charts-section.tsx b/packages/client/src/components/business/client/charts-section.tsx index 26c4da34f2..475d631b47 100644 --- a/packages/client/src/components/business/client/charts-section.tsx +++ b/packages/client/src/components/business/client/charts-section.tsx @@ -88,9 +88,9 @@ export function ChartsSection() { - + } />