Skip to content

fix(a11y): Resolve WCAG AA contrast failures across UI#1128

Merged
jeromehardaway merged 2 commits into
masterfrom
fix/wcag-contrast-audit
May 19, 2026
Merged

fix(a11y): Resolve WCAG AA contrast failures across UI#1128
jeromehardaway merged 2 commits into
masterfrom
fix/wcag-contrast-audit

Conversation

@jeromehardaway

Copy link
Copy Markdown
Contributor

Summary

  • Audited text/background color pairings sitewide and fixed every combination that failed WCAG AA (4.5:1 normal text, 3:1 for UI components and large text).
  • Extended the gray scale in tailwind.config.js with the 500/600/700/800/900 stops aliased to existing brand neutrals so the ~96 occurrences of tw-text-gray-{500..900} (previously undefined → cascading) resolve to valid brand colors.
  • Replaced failing gold-on-light text (1.4–2.4:1) with brand tokens that pass — ink, navy-deep, or red-dark per semantic intent. Gold backgrounds preserved per brand guide; only the text/icon color shifted.
  • Fixed five undefined Tailwind tokens at their call sites: gray-550, gray-750, dark-50, warning-100, secondary-200.

Scope

  • 34 files: components, containers, pages — covers admin dashboard, profile, translator suite, challenges, resume scorer, mock interview, job match, order/submission state pills, assessment, and assignment submit.
  • No design system additions outside what already exists in docs/brand-style-guide.md. All replacements use canonical brand tokens.

Out of scope (verified passing as-is)

  • Gold accents on navy/red backgrounds — Stat Belt, Donate Form, Profile Header (gold on navy passes ~9.5:1).
  • Red text on light backgrounds — already brand-compliant.

Test plan

  • npm run typecheck — passes for changed files (pre-existing j0di3 / swagger errors are unrelated to this branch).
  • npm run lint — passes for changed files (pre-existing test-file lint errors unrelated).
  • Smoke a representative set of pages in a browser at /admin, /admin/users, /admin/courses, /challenges, /challenges/[id], /orders, /submissions, /jobs, /resume-translator, /assessment, /profile, /store/products/[handle], /404 — confirm status pills, score gradients, success icons render with the new colors.
  • Spot-check dark sections (Stat Belt, Donate Form red panel, Profile Header) — confirm gold accents still appear unchanged.
  • Run npx playwright test if visual specs are in place — screenshots may shift.

Audited text/background color pairings sitewide against WCAG AA
(4.5:1 normal text, 3:1 UI components / large text). Replaced
failing combinations with brand tokens from docs/brand-style-guide.md.

Palette
- Extend gray scale with 500/600/700/800/900 aliased to existing
  brand neutrals (Slate, Charcoal, Dark Gray, Charcoal-dark, Ink).
  Resolves ~96 cascading text occurrences using undefined classes.
- Fix typo tokens (gray-550, gray-750, dark-50, warning-100,
  secondary-200) at the call site using valid brand tokens.

Contrast fixes
- Gold-deep/rich/bright text on gold-light, white, cream, gray-50
  backgrounds (1.4 to 2.4:1) replaced with ink, navy-deep, or
  red-dark per semantic intent. Affected: status badges, score
  gradients, success indicators, resume scorer chips, challenge
  test results, admin role pills, order/submission state pills.
- Decorative gold icons on light surfaces swapped to navy-deep or
  ink so non-text UI elements meet 3:1.
- Score color gradients (Resume Scorer, Mock Interview, Troop
  Dashboard) now ink to navy-deep to red-dark instead of the
  failing gold-deep to gold-rich to red-dark trio.

Out of scope
- Gold accents on navy/red backgrounds (stat-belt, donate-form,
  profile header) — already pass AA, left unchanged.
- Red text on light backgrounds — already brand-compliant.
@vercel

vercel Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vets-who-code-app Ready Ready Preview, Comment May 19, 2026 0:08am

Request Review

User feedback: high-contrast readable text on dark beats the muted
Obama-axis aesthetic when the two conflict.

Swept every `color: rgba(185, 214, 242, 0.X)` text rule on dark
sections (briefBar, eyebrows, body, leads, captions, footer
microcopy, stat-belt sublabels, software-factory hero/cta/team) to
the brand-spec `#F8F9FA` off-white — the canonical dark-mode text
token from docs/brand-style-guide.md. Off-white on navy reads
~15.5:1 (AAA), and the brand guide explicitly warns pure white is
too harsh.

Updated the unused `--muted-on-dark` CSS var to off-white so future
usages inherit the readable default. Code-comment colors in
hero-code-snippet bumped from 0.55 to 0.85 alpha — still distinct
from active code (white identifiers, gold keywords) but no longer
washed out.

Borders, dividers, and very-low-alpha decorative backgrounds
(0.08-0.4 alpha) left alone — they are structural, not text.
@jeromehardaway jeromehardaway merged commit 7a42e46 into master May 19, 2026
6 checks passed
@jeromehardaway jeromehardaway deleted the fix/wcag-contrast-audit branch May 19, 2026 00:10
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.

1 participant