Search topics
Low-contrast text in brand colours and hover states
Links and prices are set in a bright brand colour too close to white, and a button turns paler on hover just as someone is about to click it.
color: #e8762c The problem
People with low vision can't read the menu and the prices, or a button while they point at it
A bakery's site uses a bright orange as its brand colour. The menu links and the prices are set in that orange on white, so the page looks warm and the links match the logo. Under each loaf, an "Order now" button has white text on a dark orange that reads well, until the pointer is over it: the hover state switches to a paler orange, and the words almost vanish just as someone is about to click. Tab to the button and the same paler orange comes back with focus.
Each piece of text is drawn in a colour too close to the one behind it:
- Links and prices: the orange
#e8762con white, at 2.97:1. - Button hover and focus: white on
#f0954f, at 2.30:1.
WCAG 1.4.3 asks for at least 4.5:1 for normal text, and 3:1 for large text: 24px and up, or 18.66px and up when bold. The links, the prices and the button label are normal text and need 4.5:1. None of them gets there.
The brand colour is no exception: Understanding 1.4.3 exempts the logo itself, not text set in the brand's colours. And every state counts. The hover and focus colours are as much the button's text colours as the resting one, and the criterion applies to whichever one is on screen.
Anyone reading on a phone in sunlight, on a dim laptop, or through screen magnification meets the same problem. The hover failure hits mouse users at the worst moment, when they need to confirm what they are about to choose.
2 of 10 groups affected
- No vision (not affected)
- Low vision (affected)
- Colour vision (affected)
- No hearing (not affected)
- Hard of hearing (not affected)
- No speech (not affected)
- Motor (not affected)
- Reach, strength (not affected)
- Cognitive (not affected)
- Seizures (not affected)
- Limited vision People with low vision, and many older readers, lose faint text first: letters blur into the background and words have to be guessed.
- Without perception of colour People with colour vision deficiencies see some hues as closer than they look to others.
Scanners such as axe check text at rest against its background colour, so they do report the orange links and prices. They don't hover or focus anything, so a hover state that fades the text is never measured. EaseWeb's audit points at up to 20 links and buttons on a page and measures the words while the pointer is over them, but it doesn't try every state: focus, pressed, visited and selected colours still need a person. AI tools tend to pick the brand colour for links because it matches the design, and to lighten a button on hover because that is the usual "hover" look.
What the checkers report
- axe DevTools
- Elements must meet minimum color contrast ratio thresholds
- Lighthouse
- Background and foreground colors do not have a sufficient contrast ratio.
- WAVE
- Very low contrast
Try it
Read the menu and the prices, then point at or Tab to an Order now button
Can you read every word, including the button while you hover over it or focus it?
Broken Can you fix this?
- Country loaf $6.80
- Seeded rye $7.20
The fix
Give text 4.5:1 against its background, in every state
:root { --brand: #e8762c; /* 2.97:1 on white */}.nav a,.price { color: var(--brand);}.button { background: #b4501a; /* white text: 5.12:1 */ color: #fff;}.button:hover,.button:focus-visible { background: #f0954f; /* white text: 2.30:1 */}What is wrong2 points
Every colour here was picked to look right in the design file. The orange is the brand, and the paler hover feels like a light touch. But neither was measured against what is really behind the text in the state people see.
- The menu links and the prices are hard to read. The orange is only 2.97:1 on white, where normal text needs 4.5:1.
- The button's words almost vanish the moment someone points at it or tabs to it. The paler hover and focus background drops its white text from 5.12:1 to 2.30:1, below the 4.5:1 it needs.
:root { --brand: #e8762c; /* decoration only */ --brand-text: #b4501a; /* 5.12:1 on white */ --brand-strong: #8a3c0d; /* white text: 7.68:1 */}.nav a,.price { color: var(--brand-text);}.button { background: var(--brand-text); color: #fff;}.button:hover,.button:focus-visible { background: var(--brand-strong); text-decoration: underline;}How it is fixed3 steps
- Keep the brand orange for decoration, and give the links and prices a darker shade of it,
--brand-text, at 5.12:1. - Make the button's hover and focus background darker, not lighter, at 7.68:1.
- Underline the button on hover and focus, a second cue that doesn't depend on colour at all.
This fixes the Before and passes 1.4.3 in every state the code sets.
input::placeholder,textarea::placeholder { color: #6b6b6b; /* 5.33:1 on white */ opacity: 1;}Keep the brand colour, but give it a job it can do. A bright orange that fails as text can still fill a large shape, mark a decorative rule, or carry dark text on top of it. Put the text shade into its own token, so nobody has to remember which orange is safe for words.
Hover, focus, active, visited and selected states all count. Check each one that changes a colour. Watch for opacity on text and for semi-transparent text colours: the computed result is lighter than the token suggests. Each theme the site offers, dark mode included, needs its own measurement, since a pairing that passes on white can fail on grey: see dark mode with faint grey text and icons.
Some text is exempt: logos, text in disabled controls, and text that is purely decorative or not visible. Placeholder text is not exempt: Understanding 1.4.3 names it. It is often the palest text on a page, a light grey such as #a9a9a9 at 2.35:1 on white. Set its colour on ::placeholder and measure it against the field's own background.
opacity: 1 keeps anything else from fading the colour you measured. A placeholder that passes is still no label: it goes as soon as someone types, so keep a visible label as well (form fields with missing or mismatched labels).
In forced colors, the browser replaces text and background colours with the user's own, so check the hover and focus states there too rather than assume.
The WebAIM Contrast Checker is the quickest way to test a pair of colours you already know. Enter the text colour as the foreground and the colour behind it as the background, as hex values. Read the two WCAG AA results: "Normal Text" is the 4.5:1 check, and "Large Text" is the 3:1 check. If a pair fails, move the Lightness slider under the foreground until both AA results pass. That is how a text shade such as #b4501a is found from the brand's #e8762c. The checker takes an alpha value for the foreground only, so for a translucent background enter the colour that is actually rendered: copy it from the computed style in DevTools, or pick it from the screen.
Browser DevTools measure the colour in place. In Chrome or Edge, inspect the text, and in the Styles pane click the colour swatch next to color. The colour picker shows the contrast ratio against the background it detects, marks AA and AAA, and can suggest a colour that passes. To measure hover and focus, open the :hov panel, tick :hover or :focus-visible, and click the swatch again. Firefox's Accessibility Inspector reports contrast too.
The Colour Contrast Analyser (CCA), a free desktop app from TPGi, has an eyedropper that picks any pixel on the screen. Use it where DevTools can't tell the colour behind the text: a translucent layer, a gradient, or a state that is hard to hold open. Text over a photo has its own guide: low-contrast text over photos and hero images.
Design ideas
Text can be soft, or sit on the brand colour, and still be read
Five more ways to set the bakery’s words, in the guide’s own colours. Point at each one and Tab to it: three keep their ratio in every state, and two lose it at rest.
In the design file
- Write the contrast ratio and size next to every text colour. Normal text needs 4.5:1; text from 24 pixels, or 18.66 pixels bold, needs 3:1.
- Draw hover and focus for every link and button, darker than at rest, not lighter, with their ratios.
- Two oranges: the bright brand orange for decoration and a darker one for text, each named in the palette, so nobody sets text in the bright one.
Passes
- A tinted pill for the current page The current page and the hovered item sit on a #fdf0e7 tint of the brand with #8a3c0d words, 6.88:1, so the menu stays warm without pale text. The bright #e8762c, 2.97:1 on white, only draws the dot, which nobody has to read.
Country loaf $6.80
Dark words on the bright brand The bright #e8762c stays as the button’s fill, and the label is #1a1a1a at 5.85:1, so the orange from the logo carries the button. With dark words the safe hover goes lighter: #f0954f lifts it to 7.56:1.- Quiet grey meta text The date and reading time in #767676, 4.54:1 on white, the lightest neutral grey that passes for small text. Beside the #1a1a1a title, at 17.40:1, it still reads as secondary.
Fails
- A soft tag in the brand orangeWCAG 1.4.3 The brand #e8762c on its own #fdf0e7 tint is 2.66:1, where a 12px label needs 4.5:1. The same tint with #8a3c0d words is 6.88:1 and still reads as orange.
- Light grey meta textWCAG 1.4.3 The same date and reading time in #aaaaaa, 2.32:1 on white, where small text needs 4.5:1. #767676 keeps the same hierarchy and passes.
Verify the fix
3 checks.
Test with: Contrast measurement, Mouse, Keyboard, Forced colors
Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the colour tokens or the theme change.
Limits
This is a starting pattern, not a guarantee for every application. Colour values and token names are examples; measure your own palette on your real backgrounds. Text set over a photo, a slideshow or a hero image is covered in low-contrast text over photos and hero images. Text that passes 4.5:1 but not the 7:1 of Level AAA is covered in grey body text under 7:1 contrast. A contrast ratio is a minimum, not proof that text is comfortable to read: thin weights, small sizes and long lines make reading harder at the same ratio. Check the complete pages with people who rely on it.
This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.
EaseWeb service
Fixed it? Keep it from coming back.
I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.