fix(client): WCAG AA colour contrast for ThemeToggle design tokens#1
Open
DevRushd wants to merge 1 commit into
Open
fix(client): WCAG AA colour contrast for ThemeToggle design tokens#1DevRushd wants to merge 1 commit into
DevRushd wants to merge 1 commit into
Conversation
…tokens - Define colour design tokens via Tailwind v4 @theme with .dark overrides - Fix border contrast (was 1.35:1 light / 1.40:1 dark, now 4.39:1 / 3.48:1) - Consolidate duplicate :root blocks in index.css - Add contrast verification script (scripts/check-contrast.js) - Add CI step to fail on contrast regressions - Document colour system in design.md under 'Colour Tokens' section Closes crackedstudio#827
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.
Summary
Adds a proper design token system to the ThemeToggle component and ensures all colour pairs pass WCAG AA contrast ratios (4.5:1 normal text, 3:1 UI components). A CI check prevents future regressions.
Changes
client/src/index.css@themewith.darkoverrides:rootblocks into one--color-text-body/--color-bgCSS varsclient/src/components/ThemeToggle.tsxbg-surface,border-border,text-icon, etc.)dark:bg-white/10that was overridingdark:bg-white/5dark:text-white(was overridden bydark:text-white/80anyway)client/scripts/check-contrast.js(new)Zero-dependency Node.js script that:
@theme,:root, and.darkblocksclient/design.mdAdded a Colour Tokens section documenting all 7 tokens for both light and dark modes, with effective values and contrast ratios.
.github/workflows/ci.ymlAdded a
Check colour contrast (WCAG AA)step to the client CI job that runsnode scripts/check-contrast.js. The pipeline fails if any token pair drops below threshold.Contrast verification
Closes crackedstudio#827