High contrast: what it is and why it exists
Some people change the colours of their whole computer so they can read. If your site breaks when they do, they cannot use it.
What it is
It is an operating-system or browser mode that replaces colours with a small, highly contrasted palette chosen by the person. In Windows it is called “contrast themes”. In CSS you detect it with forced-colors: active.
Who uses it
- People with low vision
- People sensitive to light or with migraines
- Anyone with tired eyes or sun on the screen
What it does to your site
It changes text, background, link and button colours. It removes background images, gradients and shadows. It keeps borders, outlines and SVGs that use system colours.
What breaks
Black and white example. On a real system, each person picks their own colours.
How to fix it
- Give clickable things a border. A button without a border becomes loose text. Use a real or transparent border: the mode paints it and your design does not change.
- Focus with outline. A box-shadow disappears in high contrast. An outline is kept.
- Icons as SVG with currentColor. Background images are removed. An SVG that inherits the text colour stays visible.
- Do not mark states with colour alone. If the colour is replaced, the state is lost. Add text, an icon or a border.
- forced-color-adjust: none, only if needed. Use it only when colour is information (a chart) and add borders or labels.
.btn { border: 2px solid transparent; }
:focus-visible { outline: 3px solid; }
The chart on this site's home page was fixed this way.
How to test it
- Windows 11: Settings → Accessibility → Contrast themes.
- Chrome o Edge: DevTools → Rendering → “Emulate CSS media feature forced-colors”.
- macOS: “Increase contrast” enables prefers-contrast: more, but not forced colours.
Which criteria cover it
WCAG has no criterion saying “must work in high contrast”, but these help: