Skip to Content
Platform.Ontology

prefers-contrast

OS setting for higher or lower color contrast.

Gets silentlyScreen and windowsCSS media featuresWeb browsersWhen the page loadsWhile you use it

In one line

Can tell if you asked your device for more or less contrast

OS setting for higher or lower color contrast.

Signals low vision or light sensitivity. Values no-preference, more, less, custom. Rare, so each non-default value is highly distinguishing.

What it can and can't do

What the user does: Nothing. It happens when the page loads.

It can

  • Check whether you chose more, less or normal contrast
  • Change its colors to match
  • Add the answer to a browser fingerprint

It cannot

  • Tell why you chose it, though it can hint at a vision need
  • See your other accessibility settings
  • Change the setting

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported962021-11-15None
EdgeSupported962021-11-19None
FirefoxSupported1012022-05-31None
SafariSupported14.12021-04-26None
Safari on iPhoneSupported14.52021-04-26None
Chrome on AndroidSupported962021-11-15None
Samsung InternetSupported17.02022-05-04None

How a site asks for it

APImatchMedia('(prefers-contrast: more)')
Browser compat keyscss.at-rules.media.prefers-contrast
How access is grantednone
What the user seesNone
Needs a secure context (HTTPS)No
Needs a user gestureNo
How long it lastsread fresh on every page load; nothing stored
How to take it backnone needed (no grant)
Inside an iframeReadable from cross-origin iframes too (same values)

Typical flow

  1. Page script reads the value
  2. No prompt is shown

Data you get

Shape: object
How often: static per session

FieldTypeUnitRangePrecision
prefers-contrastenumNoneno-preference, more, less, customNot listed

The story

What it is

Tells a page whether you asked your device for more or less color contrast.

For you

You never see the check. If you turned on higher contrast, a good site gives you stronger borders and darker text without a menu.

For makers

Makers use it to make pages readable for low vision and bright sunlight. It is also a private fact. The setting may point to a disability, so careful teams do not log it.

Where you see it

TypeExampleApps
accessibilityA web app darkens gray text and thickens borders when you ask for more contrast.None named
bankingA bank dashboard uses stronger chart lines and labels for people who need higher contrast.None named
gamesA browser puzzle game boosts tile outlines so shapes are clear on a small screen.None named
mediaA reading app shows pure black on white text and removes pale gray hints.None named
educationA learning platform adapts lesson slides for students with low vision.None named
analyticsA team chooses not to record the value because it may reveal a health need.None named

Risks

  • May reveal a disability
  • Sensitive signal

What the platform says

  • MDN: prefers-contrast. Documents how a page can notice the person wants higher or lower contrast and adapt its colors.

Good uses and abuse

Legitimate uses

  • Respect OS theme and accessibility needs
  • Adapt layout

Known abuse

  • Infer disability or setting for fingerprinting

Scores

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility3 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits1Rough identifying entropy, when known

Sources

How well checked: Based on official documentation.

On this page