Skip to content

fix/light-theme-surface-contrast - #119

Merged
ebouchut merged 2 commits into
devfrom
fix/light-theme-surface-contrast
Jul 28, 2026
Merged

fix/light-theme-surface-contrast#119
ebouchut merged 2 commits into
devfrom
fix/light-theme-surface-contrast

Conversation

@ebouchut

Copy link
Copy Markdown
Owner

This PR:

  • Darkens several light-theme accent color tokens so text rendered on the slightly darker --color-surface meets WCAG2.1 AA contrast (4.5:1).
    • Catppuccin (light):
      • primary from #8839ef to #8230e8 (now 4.88:1 on --color-surface)
      • success from #2f7a1f to #2c721d (now 4.89:1 on --color-surface)
      • error from #20f39 to #80e37 (now 4.83:1 on --color-surface)
        brand mark, active nav link, and flash rendered on --color-surface previously fell below 4.5:1.
    • Soft Paper (alternate):
      • primary/link from #286983 to #256278 (now 4.98:1 on --color-surface, 5.49:1 on page bg,
        6.78:1 for --color-on-primary button text)
  • Theme doc updated to record --color-surface as the binding contrast constraint.

ebouchut added 2 commits July 28, 2026 16:16
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.
@ebouchut ebouchut self-assigned this Jul 28, 2026
@ebouchut ebouchut added documentation Improvements or additions to documentation frontend accessibility Accessibility (RGAA, WCAG) labels Jul 28, 2026
@ebouchut ebouchut moved this to In Review in learn-dev-project Jul 28, 2026
@ebouchut ebouchut added this to the v1.0- Certification - DWWM milestone Jul 28, 2026
@ebouchut
ebouchut merged commit ed3cd5c into dev Jul 28, 2026
5 checks passed
@ebouchut
ebouchut deleted the fix/light-theme-surface-contrast branch July 28, 2026 14:28
@github-project-automation github-project-automation Bot moved this from In Review to Done in learn-dev-project Jul 28, 2026
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.57%. Comparing base (70f2c56) to head (4895e8d).
⚠️ Report is 3 commits behind head on dev.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility Accessibility (RGAA, WCAG) documentation Improvements or additions to documentation frontend

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant