coderef

prefers-contrast media queryBaseline · Widely available

The prefers-contrast CSS media query sets styles based on whether the user prefers more or less contrast, the difference between foreground and background colors.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since May 31, 2022. Widely available since Nov 30, 2024.

Browser support

DesktopChrome
1–95Not supported
96+Supportedsince Nov 15, 2021
Current: 155
Edge
12–95Not supported
96+Supportedsince Nov 19, 2021
Current: 154
Firefox
1–100Not supported
101+Supportedsince May 31, 2022
Current: 157
Safari
1–14Not supported
14.1+Supportedsince Apr 26, 2021
Current: 27
MobileChrome Android
18–95Not supported
96+Supportedsince Nov 15, 2021
Current: 155
Firefox Android
4–100Not supported
101+Supportedsince May 31, 2022
Current: 157
Safari iOS
1–14Not supported
14.5+Supportedsince Apr 26, 2021
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: prefers-contrast.

Feature detection

There’s no simple runtime check for this feature; rely on the support table and test in your target browsers.