How to fix color contrast issues
If the text is too light against the background, some people cannot read it — including people with low vision, people looking at a screen in the sun, and people who simply find pale gray type exhausting. Contrast is one of the most common automated findings, and it is also one of the easiest to see once you know the numbers.
This guide covers WCAG 2.1 contrast criteria. It is general information, not legal advice.
The numbers that matter
- 1.4.3 Contrast (Minimum) — regular text should have a contrast ratio of at least 4.5 to 1 against its background. Large text (18 point, or 14 point bold, and the CSS equivalents) should have at least 3 to 1.
- 1.4.11 Non-text Contrast — meaningful graphics and interface parts, such as a button border or a checked box, should reach at least 3 to 1 against the adjacent color.
- 1.4.1 Use of Color — color cannot be the only way you convey meaning. A red outline on a field is not enough if there is no text or icon to explain the error.
Logo text that is part of a brand mark, and text in a photograph that is incidental, have limited exceptions. Body copy, links, buttons, and form instructions do not get a free pass because they are "on brand."
Failures I see all the time
Pale gray body text on white. It looks refined in a design file and fails on a real page.
Ghost buttons and low-contrast labels. A thin light border and light type on a photo or a tinted banner often miss both 1.4.3 and 1.4.11.
Text over images. A headline on a busy photo will fail unless you add a solid overlay, a scrim, or a text box behind the words.
Placeholder text used as the only instruction. Placeholders are often a mid-gray that fails contrast, and they disappear when the user types. See form labels.
Links that differ from body text by color alone, and only slightly. Underline links in body copy, or provide another cue besides a small hue shift.
Error messages that are only a red border. Add text: "Enter a valid email address."
How to fix it
1. Identify each foreground and background pair
Include hover, focus, active, and error states, not only the default. Check the button on the hero image, the footer links, the sale price, and the disabled-looking text that is actually still a link.
2. Measure the ratio
Use a contrast checker that accepts two colors and reports a ratio. The WebAIM Contrast Checker is a well-known free option. Browser developer tools can also show contrast for a selected element. If the background is a gradient or a photo, measure against the lightest or busiest area that sits behind the text, or change the design so the text has a solid backing.
3. Fix the design token, not one paragraph
If your gray-500 text fails, change the shared color (or the pair of colors) so the whole site improves. One-off hex tweaks are easy to undo on the next page.
4. Create pairs that pass, then stick to them
Dark navy text on white, and white text on dark navy, are easier to keep consistent than a forest of similar grays. Brand color is fine; it just needs a partner that meets the ratio. A bright teal that fails as small text may still work as a large heading, or as a background with white type.
5. Test the states
Hover and focus styles should still pass. A button that is 4.5 to 1 at rest and 2.8 to 1 on hover is not finished. For disabled controls, WCAG is more nuanced; do not use a "disabled" style on something that is still actionable, and do not rely on color alone to explain why a control cannot be used.
Charts and meaning
In a chart, do not use color as the only distinction between series. Add patterns, labels, or line styles. The lines or bars that convey information should also meet non-text contrast against their background when they are required to understand the graphic.
A short review checklist
- Check body text, headings, links, buttons, and form fields, including placeholders.
- Check text on images, banners, and gradients.
- Check hover, focus, and error states.
- Confirm errors and required fields are explained in text, not only in color.
- Recheck after a brand-color change.
Notes for common platforms
WordPress. Theme Customizer colors and block-editor color palettes often include light grays that fail. Limit the palette to pairs you have measured.
Shopify. Sale prices, badge text, and announcement bars are frequent misses. Check the theme settings, not only the CSS file.
Webflow. Utility classes for "light" text need a documented background they may sit on. Test the published page in more than one viewport.
Design systems and React. Put passing pairs in the shared tokens and fail the build or the review if a new pair is added without a ratio.
Related reading
Official references: 1.4.3, 1.4.11, and 1.4.1. If you want help reviewing a small-business site, text 910-931-0978 or see my resources page.