api-member
Css.supports — CSS reference
The two-argument CSS.supports API checks a property/value pair; the one-argument overload checks a supports condition string. A true result indicates acceptance, not proof of correct rendering. Use it only when JavaScript needs to branch; CSS alone can use @supports.
Formal Syntax & Structure
css syntaxcss
CSS.supports("display", "grid")Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS.supports</title><style>body{margin:0}#a{padding:8px;background:rgb(232,237,241);color:rgb(0,0,0);box-sizing:border-box}
</style><body><main id="a">Resize the viewport to explore this example.</main><script>document.getElementById("a").textContent=CSS.supports("display","grid")?"Grid accepted":"Use fallback";</script></body></html>