Add semantic color tokens — --success / --warning / --danger / --info — and migrate primitives off inlined hex #149
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
james/carol#149
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Follow-up from #139 (ADR-0024). The accent semantic in the Carol DS surfaces as a three-token set —
--accent/--accent-subtle/--accent-text— that themes override and components consume by name. The four other DS-recognised semantics (success / warning / danger / info) don't have that treatment yet: #139's primitives inline literal hex values for them, with hand-written[data-theme="dark"]overrides per component.That's a real ergonomic + correctness gap:
Badge.module.css,Field.module.css,Input.module.css,Textarea.module.css,Select.module.css) each carry their own copies of the four semantic colour pairs plus their dark-mode overrides. A future tweak to "the warning amber" has to touch every file or risk a mismatch.var(--accent-subtle)+var(--accent-text)and the theme decides what the actual colour is. The semantics deserve the same shape.[data-theme="dark"]override in component CSS is a place future themes (auto, high-contrast, etc.) have to be patched. A token-level definition is patched once.Scope
app/themes/light.cssandapp/themes/dark.css, mirroring the accent shape:--success/--success-subtle/--success-text--warning/--warning-subtle/--warning-text--danger/--danger-subtle/--danger-text--info/--info-subtle/--info-textValues lifted from the DS reference if/when the design package surfaces them; otherwise tuned to read on both
--surfaceand--bgin both themes (the dark-mode override values already in the affected components are a reasonable starting point — see the inlined#4ade80/#fbbf24/#f87171/#60a5faset).[data-theme="dark"]blocks:app/components/ui/Badge.module.css—.tone-success/-warning/-danger/-infoapp/components/ui/Field.module.css—.requiredand.errorapp/components/ui/Input.module.css,Textarea.module.css,Select.module.css— the[aria-invalid="true"]border + ring colours/dev/componentsshowcase still reads the same in both themes after the migration. The cleanest visual check is a side-by-side before/after of the showcase page.Acceptance criteria
light.cssanddark.css..module.cssfiles no longer carry inline hex values or[data-theme="dark"]overrides for the four semantics./dev/componentsrenders the same in both themes as it does today on the post-#139 baseline.npm run lint,typecheck,build,testall green.../carol-design/README.mdbefore this lands, use those values verbatim; otherwise the inlined-dark values stay the baseline.Out of scope
--brand-purple,--violet-*, etc. — the DS hasn't committed to any of them as named aliases either).Part of epic #2. Follow-up from #139 / ADR-0024.