Skip to content

fix: darken --text-muted to meet WCAG AA contrast on light backgrounds - #352

Open
MaximeGaudin wants to merge 1 commit into
mainfrom
fix/issue-120-wcag-contrast
Open

fix: darken --text-muted to meet WCAG AA contrast on light backgrounds#352
MaximeGaudin wants to merge 1 commit into
mainfrom
fix/issue-120-wcag-contrast

Conversation

@MaximeGaudin

Copy link
Copy Markdown
Owner

Summary

  • --text-muted (#6b7f8e) is used for small body text (10–13.5px: .rule-summary, .badge.plain, .back-link, .citation span, table th) on the light paper backgrounds. Measured via the WCAG relative-luminance formula, its worst case is 3.51:1 (on the body gradient's darkest stop #e4edf3) and 3.75:1 on --paper — below the 4.5:1 AA minimum for normal text.
  • Darkened --text-muted to #576874, which clears 4.5:1 on every light background it sits on: 4.87:1 on #e4edf3, 5.20:1 on --paper, 5.51:1 on --paper-raised.

Not changed (verified already passing)

  • The issue also flagged #7f93a1 at .console-bar (line 522) and footer p (line 902) as 2.87:1. That computation compared them against --paper, but both actually sit on dark panes: .console background #060c11 and footer background #071016. On their real backgrounds the contrast is 6.17:1 and 6.02:1 — comfortably above AA. No change needed.
  • --signal-bright (#14c4b5) is left as-is: the issue explicitly does not assert it as a failure (its traced usages sit on dark console/hero panels) and flags it only as a devtools follow-up.

Fixes #120

Test plan

  • Computed WCAG contrast ratios for the old and new --text-muted against every light background in the palette (#e4edf3, #eef4f7, #f7fafc); the new value is >= 4.5:1 in all cases, and the #7f93a1 / --text-secondary pairs were re-verified as passing.
  • pnpm run build in apps/docs: 48 pages built.
  • pnpm run lint (biome + astro check + check-no-todos): 0 errors, 0 warnings, clean.
  • CI green on the PR

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs site: multiple text/background color pairs fail WCAG AA contrast (below 4.5:1 for body text)

1 participant