prefers-contrast

Respect your users' contrast preference. When someone asks their system for more contrast, harden the subtle stuff. When they ask for less, soften it.

Your current setting

checking...

Reading matchMedia('(prefers-contrast: more)') live.

This helper text is the muted grey every design system ships. Ask for more contrast and it hardens, right here in the hero.

A quiet link

The code

Values: no-preference, less, more, and custom. The everyday work is in more:

CSS: harden and soften

/* harden the subtle stuff when more contrast is asked for */
@media (prefers-contrast: more) {
  .muted    { color: var(--ink); }              /* was #9a9aa6 */
  .ghost-btn {
    background: var(--purple);
    color: #fff;                                 /* was transparent */
  }
  .card     { border-color: var(--ink); }        /* was hairline grey */
  a         { text-decoration: underline; }      /* not color alone */
}

/* soften for light-sensitive users */
@media (prefers-contrast: less) {
  body { background: #f4f4f5; color: #3f3f46; }  /* no pure black on white */
}

Harden the subtle stuff when more contrast is asked for; soften for light-sensitive users.

Honest caveat: more is a preference, not a design. The query does not restyle your page; it asks you to harden the subtle stuff yourself, like this demo. And custom is the deep end: it fires for Windows contrast themes, which really want system colors and forced-color-adjust. That is the forced-colors query's territory.

Why it matters

Muted greys and hairlines look refined in a screenshot, and disappear for the people who asked for more contrast.

Quiet compromises

Every design system ships the same quiet compromises: muted grey helper text, hairline borders, ghost buttons, links you can only find by their color. They look refined in a screenshot. For someone with low vision who has asked their system for more contrast, all of it simply disappears.

The opposite ask

The opposite ask exists too. Light-sensitive users, including many people with migraines or photophobia, ask for less contrast, and a wall of pure black on pure white is its own kind of hostile.

Baseline, and already common

prefers-contrast reports both directions, and unlike most of its prefers-* siblings, this one is Baseline: every browser has reported it since 2021, and Chrome sees a non-default contrast preference on roughly a quarter of page loads. These users are on your site right now.

This is the one member of the family you can ship unconditionally. No flags, no drafts, no waiting. It works in Chrome, Edge, Firefox, and Safari today.

Try it

A card built the way design systems build them: muted helper text, a hairline-bordered ghost button, a quiet link. Use the override to preview each path.

New

A card built for the default

This is the muted grey helper text every design system ships. The hairline border, the ghost button, the barely-there link. All of it disappears for someone who asked for more contrast.

A quiet link

One component, three skins. more hardens the subtle stuff: muted text goes full ink, the ghost button gets a real fill, the link gets an underline. less softens everything for light-sensitive users. Nothing is restyled from scratch; the component just listens.

Best practices

Preference beyond the floor, not a substitute for it.

Meet WCAG contrast minimums first

This query is for preference beyond the floor, not a substitute for the floor. 4.5:1 for body text, always.

Harden the subtle stuff, not everything

Muted text, hairlines, ghost buttons, placeholder text. Your headings are probably fine already.

Never signal by color alone

In the more path, give links underlines and states shapes or labels, not just stronger hues.

Respect less too

Avoid pure black text on pure white for light-sensitive users; a very dark grey on off-white reads softer.

Leave custom to forced-colors

When Windows contrast themes are active, the OS palette should win. Do not fight it with your brand colors.

Browser support

Baseline, Widely Available since late 2024.

96

Chrome

November 2021.

96

Edge

November 2021.

101

Firefox

May 2022.

14.1 / 14.5

Safari

14.1 on macOS, 14.5 on iOS, April 2021.

Baseline, Widely Available since late 2024. Chrome and Edge 96 (November 2021), Firefox 101 (May 2022), and Safari 14.1 on macOS / 14.5 on iOS (April 2021). The readout at the top of this page is your real setting, not a guess.