The colormedia feature tests how many bits per color component (red, green, blue) the output device supports. Use it inside @media to enhance styles on color screens and keep simple fallbacks for monochrome output.
It is a range feature: you can use (color), (color: <integer>), (min-color: <integer>), and (max-color: <integer>). A value of 0 means the device is not a color device. This is not the same as the color property.
Baseline widely available.
Supported across modern browsers since mid‑2015. Almost every phone and monitor matches (color); use it for progressive enhancement, not as your only layout switch.
Negate the feature.not (color) matches when bits = 0.
Use contrast, not hue. Borders and black/white carry meaning without color.
Rare on phones. You may not see the fallback here; it still matters for specialized displays.
Edge Cases & Pitfalls
Most mistakes come from confusing this feature with the color property or expecting rare monochrome matches.
vs property
Not the color property
This media feature does not set text color. Use the color property for that. The media feature only answers “how many bits per channel?”
bits
Smallest channel wins
If red/blue use 5 bits and green uses 6, the device counts as 5 bits per component. Indexed color uses the table’s minimum.
rare
not (color) rarely matches
Phones and monitors almost always match (color). Keep monochrome styles as progressive fallbacks, not your primary design path.
gamut
Bits ≠ wide gamut
color is bit depth. Wide color ranges use color-gamut (srgb, p3, rec2020).
Compatibility
Browser Support
The color media feature is a browser CSS capability query. Node.js, Deno, and Bun do not evaluate it.
✓ Baseline · Widely available
color
Supported in Chrome, Firefox, Safari, Edge, Opera, and older browsers that implement CSS media queries. Boolean, min-, and max- forms are safe for production.
99%Global support
Google ChromeSupported
Full support
Mozilla FirefoxSupported
Full support
Apple SafariSupported
Full support
Microsoft EdgeSupported
Full support
OperaSupported
Full support
Samsung InternetSupported
Full support
Internet Explorer9+
Full support
@media (color)Baseline · Widely available
Bottom line: Safe to use for progressive color enhancement. Almost all consumer devices match (color). This is not a JavaScript runtime API.
Remember
Key Takeaways
Role: report bits per RGB component of the output device.
Boolean (color) means “any color device.” 0 means none.
Use min-color to gate richer styles; keep solid base styles outside the query.
Different from the color property and from color-gamut.
One line:@media (color) asks “can this screen show color?” — enhance when yes, stay readable when no.
Frequently Asked Questions
It reports how many bits per color component (red, green, blue) the output device supports. Use it inside @media to style color-capable screens differently from monochrome ones.
The boolean form matches when the device has more than zero bits per color component — essentially any color display. Zero means a non-color (monochrome) device.
The media feature checks device capability inside @media. The color property sets an element’s foreground text color. Same word, different jobs.
min-color matches when the device supports at least that many bits per component. For example, (min-color: 8) targets typical true-color displays.
If channels use different bit counts, the smallest number is used. Indexed-color devices use the minimum bits per component in the color table.
Yes. It is Baseline Widely available. It is a browser CSS media feature, not a Node.js API.