files/en-us/web/api/csssupportsrule/index.md
{{APIRef("CSSOM")}}
The CSSSupportsRule interface represents a single CSS {{cssxref("@supports")}} at-rule.
{{InheritanceDiagram}}
Inherits properties from its ancestors {{domxref("CSSConditionRule")}}, {{domxref("CSSGroupingRule")}}, and {{domxref("CSSRule")}}.
Inherits methods from its ancestors {{domxref("CSSConditionRule")}}, {{domxref("CSSGroupingRule")}}, and {{domxref("CSSRule")}}.
The CSS includes a CSS feature query using the {{cssxref("@supports")}} at-rule, containing one style rule. This will be the first CSSRule returned by document.styleSheets[0].cssRules.
myRules[0] therefore returns a CSSSupportsRule object.
@supports (display: grid) {
body {
color: blue;
}
}
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0]); // a CSSSupportsRule representing the feature query.
{{Specifications}}
{{Compat}}