Buttons and links must keep enough contrast on hover and focus

Many themes lighten or invert buttons on hover and focus. When the text turns pale grey on white at the exact moment a customer points at "Add to cart", people with low vision or colour vision deficiency can no longer read it.

Rule id
vs-hover-focus-contrast
Source
Validiscan check
Impact
Serious
Fix tier
ASSISTED
on Shopify, Shopware, WooCommerce and Magento
Status
runs

What the check does

Measures the text contrast (1.4.3) and the contrast of borders and indicators (1.4.11) of buttons and links in their hover and focus states, which static contrast checks do not see.

The check reads a[href], button, [role="button"], [role="link"] and input buttons, skipping disabled, hidden and nearly transparent ones. It samples one element per style (tag, class, colors, font, page region), up to 60 per page, and freezes CSS transitions to read final colors.

After one real Tab press, so :focus-visible applies, each sample is read in its default state, then focused. Samples with text that are topmost at their center are also hovered with the mouse, until 10 seconds into the check.

Text is a finding when a hover or focus state with changed colors falls below 4.5:1, or 3:1 for large text (24 px, or 18.66 px bold). Colors are composited through ancestor backgrounds and opacity onto white; text over an image, video or other overlapping box is skipped. A focus outline or added box-shadow is a finding when the best one is below 3:1 against the adjacent background; the browser’s auto ring is not measured. Borders, underlines and background changes are not measured as focus indicators.

How to fix it

Choose hover and focus colours that keep at least 4.5:1 contrast for text (3:1 for large text) and at least 3:1 for button borders and focus indicators, ideally by adjusting the theme's colour variables so every state keeps enough contrast.

WCAG success criteria

EN 301 549 clauses

The EN 301 549 clause of each criterion, by version of the standard
WCAG criterion Version 3.2.1 Version 4.1.1
1.4.3 9.1.4.3 9.1.4.3
1.4.11 9.1.4.11 9.1.4.11

Start with a free check of your shop.

Send your shop’s address. Validiscan scans it and replies with every failure the scan can prove, with the page and the code.

Request a free check

Or write to info@validiscan.com.

What the free check covers, and what it leaves out
You send
your shop’s address
Pages scanned
up to 15
You get
every failure the scan can prove, with the page and the code
On your shop
public pages only; no login, nothing bought, no forms sent
What it is not
a full audit

Write to Validiscan

For a free check, give the address of your shop and its platform.

Validiscan uses what you send to answer you. Privacy notice