Designers love soft muted grays like Tailwind's slate-400 (#94A3B8) for timestamps, input hints, and card subtitles on crisp macOS Retina displays indoors. Then a real user opens the site outdoors on a phone at 50% brightness—or runs a Lighthouse Accessibility audit—and #94A3B8 on white clocks in at 2.56:1, failing WCAG AA by nearly half.
The Three WCAG 2.1 Contrast Numbers Worth Memorizing
| Element Category | WCAG AA Minimum | WCAG AAA Target | Safe White-Bg Gray Token |
|---|---|---|---|
| Normal body & caption text (< 24px) | 4.5 : 1 | 7.0 : 1 | #64748B (4.76:1) or #475569 (7.58:1) |
| Large headings (≥ 24px or ≥ 18.66px bold) | 3.0 : 1 | 4.5 : 1 | #64748B passes AAA large |
| Input borders, icons & focus indicators | 3.0 : 1 | N/A (SC 1.4.11) | #94A3B8 border or darkened focus ring |
Fixing Failing Brand Colors Without Making Them Muddy
- Shift HSL Lightness, keep Hue & Saturation: When a brand emerald (
#10B981) fails with white button text (2.54:1), do not mix black blindly in RGB. Drop HSL lightness down to#047857(5.48:1) so the button still reads unmistakably emerald while passing AA. - Form input borders count too: Under WCAG 1.4.11 (Non-text Contrast), an input box whose border is
#F1F5F9on a#FFFFFFpage is practically invisible to low-vision users. Test your border and focus colors directly in our CSS Input Styles Generator.
Frequently Asked Questions
Do disabled buttons and decorative logos need 4.5:1 contrast?
No. WCAG explicitly exempts disabled UI controls, purely decorative graphics, and official brand logotypes—though keeping disabled labels legible is still kind UX.
Why does white text on bright orange (#F97316) fail WCAG AA?
Relative luminance weights green at 71.5% and red at 21.3%, making bright orange mathematically luminous (~3.1:1 against white). Switching the button label to dark #0F172A jumps contrast above 6.5:1 instantly.