fix(client): activate the shadcn colour tokens - #4279
Merged
Conversation
`components.json` declared `cssVariables: false` and pointed at `tailwind.config.cjs`, a file that does not exist anywhere in the monorepo — it was deleted during the Tailwind 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. Verified against two independent build outputs: `text-muted-foreground`, `bg-card`, `border-border` and `text-destructive` each emitted zero rules, while `bg-gray-900` emitted 25. Secondary text rendered at full-strength body colour, `bg-muted` / `bg-accent` / `bg-card` were transparent, and error text rendered black rather than red. Define the full token set in `@theme` on shadcn's `gray` base, with `.dark` overrides in `@layer base`. Plain `@theme` rather than `@theme inline`, since inline substitutes literals into each utility and would make the dark overrides dead code. Values are literal `oklch()` rather than `var(--color-gray-500)` references, because v4 only emits the default palette variables it sees used — referencing an otherwise-unused one would resolve to nothing. Tokens standing in for an existing default take that default's value, so previously-inert classes stay visually unchanged: background/card are white (already the page background), foreground is gray-950 (already the inherited text colour), 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 muted/accent/secondary backgrounds gain their light tint. Also fix `business/client/charts-section.tsx`, which set axis ticks with `hsl(var(--muted-foreground))`. That is v3 syntax: the v4 token holds a colour, not an HSL triplet, so the wrapper produced an invalid value and the ticks fell back to Recharts' default. Its `hsl(var(--chart-N))` siblings are correct and unchanged — that family really is stored as triplets. Dark mode stays inert: `next-themes` is installed but no `ThemeProvider` is mounted, so nothing puts `.dark` on an ancestor. The overrides are defined so the ~425 `dark:` utilities already in the codebase are correct when that switch is wired. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gilgardosh
temporarily deployed
to
accounter-fullstack
August 24, 2026 10:34 — with
GitHub Actions
Inactive
gilgardosh
temporarily deployed
to
accounter-fullstack
August 24, 2026 10:34 — with
GitHub Actions
Inactive
Contributor
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@accounter/client |
0.1.0-alpha-20260824103610-d60c0c36ce983038dc9276b5c6ec04edf7d7c115 |
npm ↗︎ unpkg ↗︎ |
@accounter/green-invoice-graphql |
0.8.7-alpha-20260824103610-d60c0c36ce983038dc9276b5c6ec04edf7d7c115 |
npm ↗︎ unpkg ↗︎ |
@accounter/hashavshevet-mesh |
0.2.13-alpha-20260824103610-d60c0c36ce983038dc9276b5c6ec04edf7d7c115 |
npm ↗︎ unpkg ↗︎ |
@accounter/israeli-vat-scraper |
0.1.13-alpha-20260824103610-d60c0c36ce983038dc9276b5c6ec04edf7d7c115 |
npm ↗︎ unpkg ↗︎ |
@accounter/modern-poalim-scraper |
0.11.0-alpha-20260824103610-d60c0c36ce983038dc9276b5c6ec04edf7d7c115 |
npm ↗︎ unpkg ↗︎ |
@accounter/payper-mesh |
0.2.13-alpha-20260824103610-d60c0c36ce983038dc9276b5c6ec04edf7d7c115 |
npm ↗︎ unpkg ↗︎ |
@accounter/scraper-app |
0.0.3-alpha-20260824103610-d60c0c36ce983038dc9276b5c6ec04edf7d7c115 |
npm ↗︎ unpkg ↗︎ |
@accounter/server |
0.2.0-alpha-20260824103610-d60c0c36ce983038dc9276b5c6ec04edf7d7c115 |
npm ↗︎ unpkg ↗︎ |
@accounter/shaam-uniform-format-generator |
0.2.7-alpha-20260824103610-d60c0c36ce983038dc9276b5c6ec04edf7d7c115 |
npm ↗︎ unpkg ↗︎ |
@accounter/shaam6111-generator |
0.1.9-alpha-20260824103610-d60c0c36ce983038dc9276b5c6ec04edf7d7c115 |
npm ↗︎ unpkg ↗︎ |
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
It introduces app-wide theme token behavior changes that can have broad UI/contrast impact and warrants final human visual verification across key screens/browsers.
Pull request overview
Activates shadcn/ui color tokens in the client by defining the Tailwind v4 @theme token set (plus dark overrides) so utilities like text-muted-foreground, bg-card, border-border, and text-destructive stop compiling to no-ops across the app.
Changes:
- Define shadcn/ui color tokens via Tailwind v4
@themeinsrc/index.css, with.darkoverrides in@layer base. - Fix Recharts axis tick colors to reference the v4 token (
--color-muted-foreground) directly. - Update shadcn
components.jsonto enable CSS variables and remove the stale Tailwind config path.
File summaries
| File | Description |
|---|---|
| packages/client/src/index.css | Adds the shadcn color token set in @theme and dark-mode overrides so token-based utilities generate correctly. |
| packages/client/src/components/business/client/charts-section.tsx | Fixes chart axis tick fill to use the v4 token variable (--color-muted-foreground). |
| packages/client/components.json | Enables cssVariables and clears the non-existent Tailwind config path to match the CSS-first v4 setup. |
| .changeset/activate-shadcn-color-tokens.md | Documents the patch release and the rationale/impact of activating the tokens. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
components.jsondeclaredcssVariables: falseand pointed attailwind.config.cjs— a file that does not exist anywhere in the monorepo. It was deleted during the Tailwind v3 → v4 migration and the theme layer was never ported to v4's CSS-first@theme, so--color-card,--color-muted-foreground,--color-destructiveand the rest were never registered, and Tailwind never generated the utilities that reference them.Roughly 380 usages across ~100 files were compiling to nothing. Verified against two independent build outputs (one from Aug 23, one from Aug 17):
text-muted-foregroundbg-cardborder-bordertext-destructivebg-mutedbg-accentbg-gray-900(control)So secondary text rendered at full-strength body colour,
bg-muted/bg-accent/bg-cardwere transparent, and error text rendered black instead of red.How
src/index.cssnow defines the token set in@themeon shadcn'sgraybase (percomponents.json), with.darkoverrides in@layer base.Two deliberate choices worth reviewing:
@theme, not@theme inline. Inline substitutes the literal value into each utility, which would make the.darkoverrides below it dead code.oklch()values rather thanvar(--color-gray-500)references. Tailwind v4 only emits the default palette variables it sees used, so referencing one that happens to be unused elsewhere would resolve to nothing.Tokens that stand in for an existing default were given that default's value, so classes that were previously no-ops stay visually unchanged: background/card are white (already the page background), foreground is gray-950 (already the inherited text colour), border is gray-200 to match the
border-colorcompatibility rule already in the base layer.The visible changes are the genuinely broken cases:
text-destructivereads red-600 instead of blackAlso fixed
business/client/charts-section.tsxset its axis ticks withhsl(var(--muted-foreground)). That is v3 syntax — the v4 token is--color-muted-foregroundand holds a colour, not an HSL triplet, so thehsl()wrapper produced an invalid value and the ticks silently fell back to Recharts' default. Itshsl(var(--chart-N))siblings are correct and unchanged; that family really is stored as triplets.Verification
tscclean,eslintclean,prettierclean. 3596 unit tests pass — the single failure is the pre-existingpackages/migrations/rls-all-tablestest, which needs DB-create privileges and is unrelated.Driven live against the mock server (
yarn mock:client), confirming GraphQL hitlocalhost:4000and not production. Computed styles read off the running app:text-muted-foregroundoklch(0.551 0.027 264.364)= gray-500text-foregroundoklch(0.13 0.028 261.692)= gray-950bg-card/bg-backgroundrgb(255,255,255)bg-muted/bg-accent/bg-secondaryoklch(0.967 0.003 264.542)= gray-100text-destructive/bg-destructiveoklch(0.577 0.245 27.325)= red-600border-border/border-inputoklch(0.928 0.006 264.531)= gray-200ring-ring/40#99a1af66= gray-400 @ 40%All 19 tokens are defined and every utility the codebase actually writes resolves. (
bg-popoverand barering-ringare written nowhere in source, so Tailwind correctly never generates them — the variables are there for when something does.)Screens walked and eyeballed:
/securities,/businesses/ledger,/tags,/sort-codes,/tax-categories,/reports,/reports/annual-revenue,/. No lost contrast, no illegible text, no layout shift.What to look at
This is an app-wide appearance change, which is exactly why it is split out from the charges work that needs it. The thing worth your eye is whether muted text reading gray-500 and error text reading red-600 is the intended look on the screens you know best — the heaviest consumers are the 60 files using
text-muted-foreground.Dark mode
Still inert.
next-themesis installed but noThemeProvideris mounted (root-layout.tsxmounts MUI's), so nothing ever puts.darkon an ancestor. The overrides are defined so the ~425dark:utilities already in the codebase are correct when that switch is wired — activating it is a separate change.🤖 Generated with Claude Code