Skip to content

Orange links, a hero headline and a hover state that are hard to read

Text is drawn in colours too close to what is behind it: a bright brand colour, a light photo, or a paler hover state.

01

The problem

People with low vision can't read the menu, the headline over the photo, or a button while they point at it.

02

Try it

Read the menu and the headline, then point at or Tab to the button.

Can you read every word, including the button while you hover over it or focus it?

Crumb & Co

Baked this morning

Sourdough, buns and seasonal tarts.

Country loaf $6.80 In basket: 0

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Give every piece of text 4.5:1 against what is really behind it, in every state.

  1. 1Normal text needs 4.5:1; text 24px and up, or 18.66px bold and up, needs 3:1.
  2. 2Measure text over an image against the lightest part it can land on, and give it a backing.
  3. 3Hover and focus need the same ratio as the resting state, so darken rather than lighten.
Before The brand colour, a bare photo, and a paler hover
:root {  --brand: #e8762c; /* 2.97:1 on white */}.nav a,.price {  color: var(--brand);}.hero-text {  color: #fff; /* 1.21:1 over the cream wall */}.button {  background: #b4501a; /* white text: 5.12:1 */  color: #fff;}.button:hover,.button:focus-visible {  background: #f0954f; /* white text: 2.30:1 */}
After A text shade of the brand, a backing, and a darker hover
: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);}.hero-text {  color: #fff;  /* White text: 5.74:1 even if the photo is pure white */  background: rgb(0 0 0 / 0.6);  padding: 1rem 1.25rem;}.button {  background: var(--brand-text);  color: #fff;}.button:hover,.button:focus-visible {  background: var(--brand-strong);  text-decoration: underline;}

04

Verify the fix

4 checks.

Test with: Contrast measurement, Mouse, Keyboard, Forced colors

0 of 4 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the colour tokens, the theme or the hero images 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. 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.

Keep this fixed as your code changes.

Turn guides like this into rules your coding agents and CI follow, then have the result retested with a keyboard and screen readers.

How retests work