You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P2][convention] 340 hardcoded palette colours in 46 files bypass the theme tokens #706
1450 var(--color-*) token usages
340 hardcoded Tailwind palette classes (text-red-400, bg-amber-900, …)
46 of 70 component files contain at least one
The token system is real and mostly followed — 81% of colour usage goes
through it. The remaining 19% is the problem, because a hardcoded colour is
the same value in both themes by definition.
These are overwhelmingly status colours — errors, warnings, success — for
which tokens already exist (--color-error, --color-warning, --color-success). The token was available and the palette class was reached
for instead.
Why it matters beyond tidiness
#218 was filed because the Compare feature rendered light dropdowns with
invisible labels in dark mode. That was fixed at the instance. The cause —
colours chosen outside the token system, which therefore cannot respond to a
theme — is still present in 46 files, and #700 shows what happens when a
theme's values are not held to a standard.
It also blocks custom themes. NFR-5.2 wants user themes (#350); a theme can
only restyle what goes through tokens, so today a custom theme would leave 340
colours untouched.
Fix
Map the status colours onto existing tokens — that is the bulk of the 340.
For the genuine gaps (bg-red-500/15 tinted panels, amber "caution"
surfaces), add the tokens they imply: --color-error-surface, --color-warning-surface, --color-success-surface, and their
light-theme values.
Add a lint rule banning bare palette classes in src/components, so the
count cannot climb back.
Step 3 is what makes this stick. Without it this is a cleanup that decays.
Found during the UI review. Depends on #700 landing first, so the tokens
these map onto are themselves correct in light theme.
Activity
fix(theme): make the themes we author readable, and prove it (#708)
fix(a11y): make white button labels readable in every state, not just…
fix(theme): take status colours out of the palette and put them in th…