contrast-color()Baseline · Newly available
The contrast-color() CSS function picks a color that has guaranteed contrast against a specified foreground or background color.
Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Apr 10, 2026.
Browser support
DesktopChrome
1–146Not supported
147+Supportedsince Apr 7, 2026
Current: 155Edge
12–146Not supported
147+Supportedsince Apr 10, 2026
Current: 154Firefox
1–145Not supported
146+Supportedsince Dec 9, 2025
Current: 157Safari
1–18.6Not supported
26+Supportedsince Sep 15, 2025
Current: 27MobileChrome Android
18–146Not supported
147+Supportedsince Apr 7, 2026
Current: 155Firefox Android
4–145Not supported
146+Supportedsince Dec 9, 2025
Current: 157Safari iOS
1–18.6Not supported
26+Supportedsince Sep 15, 2025
Current: 27How to use
Every current browser supports this, but it only became Baseline on Apr 10, 2026. Use it as a progressive enhancement, or keep a fallback if you support older devices.
Example
Full syntax and examples are on MDN: contrast-color.
Feature detection
CSS · check before using
@supports (color: contrast-color(red)) {
/* styles that use contrast-color */
}
/* or in JavaScript */
if (CSS.supports("color", "contrast-color(red)")) {
// use it
}