concept
Media feature boolean context — CSS reference
A feature in boolean context tests whether its value is nonzero or otherwise not the feature’s defined false value. For a color output feature, nonzero bits per component match. Boolean syntax is not equivalent to every explicit discrete value.
Formal Syntax & Structure
css syntaxcss
@media (color) { /* conditional declarations */ }Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>media-feature-boolean-context</title><style>body{margin:0}#a{padding:8px;background:rgb(232,237,241);color:rgb(0,0,0);box-sizing:border-box}@media (color) {#a{color:rgb(0,100,0)}}</style><body><main id="a">Resize the viewport to explore this example.</main></body></html>