refactor(pwa): add semantic colour tokens + migrate primitives off inlined hex (#149) #174
No reviewers
Labels
No labels
area:auth
area:ci
area:db
area:infra
area:native
area:pwa
area:service
epic
feature
foundation
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
james/carol!174
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "149-semantic-color-tokens"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #149.
Summary
Adds the four DS-style semantic triplets —
--success/--warning/--danger/--info, each with-subtleand-textsiblings — toapp/themes/light.cssandapp/themes/dark.css(and theauto-when-OS-prefers-dark branch). Values lifted verbatim from the hex literals the five primitive stylesheets used to inline.Token shape
Mirrors accent (
--accent/--accent-subtle/--accent-text):--name: base — used for active borders, focus rings, icon fills.--name-subtle: low-alpha background tint.--name-text: readable foreground on-subtle.Base + subtle stay in lockstep across themes; only
--*-textshifts to keep contrast on the flipped surface.Files migrated
Badge.module.css— every.tone-*rule readsvar(--*-subtle)+var(--*-text). Removed all four per-tone[data-theme="dark"]+auto-media-query overrides.Field.module.css—.requiredand.errorreadvar(--danger-text). Matching dark + auto overrides removed.Input.module.css,Textarea.module.css,Select.module.css—aria-invalidborder readsvar(--danger); focus ring usescolor-mix(in srgb, var(--danger) 35%, transparent)so its alpha tracks the base colour.Visual parity
Captured
/dev/componentsscreenshots in both themes before and after.[data-theme="dark"] .tone-success { color: #4ade80; }selector matched any.tone-successdescendant of the dark page, including badges inside the nested light panel, leaving them rendering dark text on a light surface. Tokens cascade through nesteddata-themescopes correctly, so the light panel now shows light-theme badge colours. This is a strict improvement — no real-app surface relied on the old behaviour (nested mixed-theme scopes only exist in/dev/components).Browser support note
color-mix(in srgb, ...)is used in the three input primitives' focus rings. Supported in Chrome 111+, Firefox 113+, Safari 16.2+ (all current). Targets line up with the rest of the codebase.Test plan
npm run lint/npx tsc --noEmit/npm test/npm run buildall clean (440 passed)./dev/componentslight-mode: byte-identical before/after./dev/componentsdark-mode: only the nested light panel changed, in the way that's strictly correct.🤖 Generated with Claude Code
📊 Test coverage
Patch coverage: no testable lines changed.
Overall (
app/,lib/,db/, excluding UI per ADR-0019):Soft thresholds per ADR-0019. Coverage is informational and does not block merge.
Trivy (container image)
Threshold:
high· Total findings: 121 · At/above threshold: 16.27.0, 7.28.0, 8.5.0