Skip to content
easeweb
Search topics

High contrast mode hiding focus, icons and selections

The chosen option is shown only by a background fill, the focus ring is a box shadow and the icon has a fixed fill, so a contrast theme removes all three.

WCAG 2.2
SC 1.4.11AA· new in 2.1
Required by
EN 301 549 (EU)
Broken input:checked + label { background: #1a1a1a; }
The accessibility problem illustrated: In a dark contrast theme, M is chosen. Nothing shows it.
01

The problem

People who use a contrast theme can't tell which size is chosen, where focus is, or that the save button is there.

02

Try it

Turn the contrast theme on, choose a size, then press Tab.

The switch draws the page as a dark Windows contrast theme would. Can you still see which size is chosen, where focus is, and the save button?

Broken Can you fix this?

Merino crew jumper

Oat · 89.00

Size

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Draw state, focus and icons with what a contrast theme keeps, or redraw them in system colours.

  1. 1A selected state needs a cue besides its fill: a border, a tick or a system colour.
  2. 2Focus needs an outline, even a transparent one, not only a box shadow.
  3. 3Icons in controls follow currentColor or a system colour, never a fixed fill.
Before State, focus and icon drawn only in the page's colours
<fieldset class="sizes">  <legend>Size</legend>  <input type="radio" name="size" id="size-m" value="m" checked>  <label for="size-m">M</label>  …</fieldset><button class="save" aria-label="Save to wishlist">  <svg viewBox="0 0 24 24" aria-hidden="true">    <path fill="#1a1a1a" d="…"/>  </svg></button>
After

Styles a contrast theme keeps

<fieldset class="sizes">  <legend>Size</legend>  <input type="radio" name="size" id="size-m" value="m" checked>  <label for="size-m">    <svg class="tick" viewBox="0 0 24 24" aria-hidden="true">      <path        fill="none"        stroke="currentColor"        stroke-width="3"        d="M5 12l5 5 9-10"      />    </svg>    M  </label>  …</fieldset><button class="save" aria-label="Save to wishlist">  <svg viewBox="0 0 24 24" aria-hidden="true">    <path fill="currentColor" d="…"/>  </svg></button>

Fixing this with an AI coding assistant? Get this guide as Markdown

04

Verify the fix

5 checks, no mouse.

Test with: Forced colors, Keyboard, Contrast measurement

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after shared component styles or the icon set change.

Limits

This is a starting pattern, not a guarantee for every application. Contrast themes differ between Windows versions and browsers, and Firefox's own colour override behaves slightly differently again. Normal-colour contrast is a separate requirement, covered in low-contrast form fields, icons and focus rings. Test the complete pages with people who use a contrast theme every day.

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