fix/light-theme-surface-contrast - #119
Merged
Merged
Conversation
An axe scan of the light theme flagged the header brand mark and the active nav link: the primary mauve scored 4.45:1 against the header surface, under the WCAG 2.1 AA floor of 4.5:1 (RGAA 3.2). Root cause: theme ratios were validated against --color-bg only, while the header, flash alerts, and cards render accent text on the slightly darker --color-surface. Success and error carried the same latent defect (4.40:1 and 4.46:1 on surface) in the flash alert components. The three tokens darken just enough to clear 4.5:1 on the surface, keeping their hue: primary #8839ef => #8230e8 (4.88:1), success #2f7a1f => #2c721d (4.89:1), error #d20f39 => #c80e37 (4.83:1). Ratios on the page background and white-on-primary button text all improve as a side effect; the dark theme already passed and is untouched. The theme exploration doc now records the surface as the binding constraint.
The unlinked alternate theme carries the same latent defect the Catppuccin fix addressed: its ratios were validated against --color-bg only, and the shared primary/link teal #286983 scores 4.48:1 against --color-surface, under the 4.5:1 AA floor (RGAA 3.2), exactly where the header and flash alerts would render it if this theme were linked. Both tokens darken to #256278 (4.98:1 on surface, 5.49:1 on the page background, 6.78:1 for white button text); the focus token keeps the original teal since its 3:1 non-text requirement already holds. The dark side (Frappe) passes unchanged.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #119 +/- ##
=========================================
Coverage 81.57% 81.57%
Complexity 201 201
=========================================
Files 38 38
Lines 863 863
Branches 53 53
=========================================
Hits 704 704
Misses 125 125
Partials 34 34 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
This PR:
--color-surfacemeets WCAG2.1 AA contrast (4.5:1).primaryfrom#8839efto#8230e8(now4.88:1on--color-surface)successfrom#2f7a1fto#2c721d(now 4.89:1 on--color-surface)errorfrom#20f39to#80e37(now4.83:1on--color-surface)brand mark,active nav link, andflashrendered on--color-surfacepreviously fell below4.5:1.#286983to #256278 (now4.98:1on--color-surface,5.49:1onpage bg,6.78:1for--color-on-primarybutton text)--color-surfaceas the binding contrast constraint.