The color-gamut media feature matches the approximate range of colors the user agent and output device can support. Use it inside @media to serve richer accents on wide-gamut screens while keeping sRGB-safe defaults everywhere else.
The keywords are srgb, p3, and rec2020. Wider gamuts include narrower ones — a P3 display also matches srgb. This is different from the color feature, which reports bits per component.
Baseline widely available.
Supported across modern browsers. Use it for progressive enhancement — always write sRGB-safe base styles first.
Syntax
CSS Syntax
syntax.css
@media(color-gamut: srgb | p3 | rec2020) { … }
Example: @media (color-gamut: p3) { … }.
Values
Feature Values
Value
Description
Try it
srgb
Approximately the sRGB gamut or more (most color displays)
Match srgb first. Most screens pick up the light blue.
Override with p3. Wider screens get a stronger blue because this rule comes later.
Finish with rec2020. Only the widest displays take the deepest blue.
Edge Cases & Pitfalls
Most issues come from cascade order or treating gamut as bit depth.
inclusion
Wider includes narrower
A P3 display matches both srgb and p3. Put the wider query after the narrower one so it can override.
vs color
Not the same as color
color is bits per channel. color-gamut is how wide the color range is. You often use both for different questions.
fallback
Always keep sRGB defaults
Never rely only on P3 or Rec. 2020 colors. Base styles must remain readable on standard monitors.
approx
Approximate match
The feature is approximate (“about this gamut or more”). Do not treat it as a precise color-management certificate.
Compatibility
Browser Support
color-gamut is a browser CSS media feature. Node.js, Deno, and Bun do not evaluate it.
✓ Baseline · Widely available
color-gamut
Supported in modern Chrome, Firefox, Safari, and Edge. Use progressive enhancement with sRGB base styles.
95%Modern browsers
Google ChromeSupported
Full support
Mozilla FirefoxSupported
Full support
Apple SafariSupported
Full support
Microsoft EdgeSupported
Full support
OperaSupported
Full support
Samsung InternetSupported
Full support
Internet ExplorerNo
No support
@media (color-gamut)Baseline · Widely available
Bottom line: Safe for progressive wide-gamut styling. Always ship sRGB-safe defaults. This is not a JavaScript runtime API.
Remember
Key Takeaways
Role: match approximate display gamut — srgb, p3, or rec2020.
Inclusion: wider queries also match narrower keywords.
Cascade: write sRGB → P3 → Rec. 2020 so the widest wins.
Enhance only: never drop sRGB-safe defaults.
One line:color-gamut lets capable screens go wider — start in sRGB, then step up to P3 and Rec. 2020.
Frequently Asked Questions
It matches approximately how wide a color range the user agent and output device can support — roughly sRGB, Display P3, or Rec. 2020 — so you can enhance colors on capable screens.
srgb is the common web color space. p3 (Display P3) is wider and includes sRGB. rec2020 is wider still and includes P3, mostly on high-end HDR displays.
Yes. Wider gamuts include narrower ones. A P3 display also matches (color-gamut: srgb). Put base sRGB styles first, then override with p3 and rec2020 rules later.
The color feature reports bits per RGB component (color vs monochrome depth). color-gamut reports how wide the reproducible color range is on a color display.
No. Always provide sRGB-safe defaults. Treat p3 and rec2020 as progressive enhancement so every screen stays readable.
Yes. It is Baseline Widely available. It is a browser CSS media feature, not a Node.js API.