files/en-us/web/api/cssimportrule/index.md
{{APIRef("CSSOM")}}
The CSSImportRule interface represents an {{cssxref("@import")}} at-rule.
{{InheritanceDiagram}}
Inherits properties from its ancestor {{domxref("CSSRule")}}.
null if the rule doesn't declare any.media attribute of the associated stylesheet.Inherits methods from its ancestor {{domxref("CSSRule")}}.
The document includes a single stylesheet which contains a single {{cssxref("@import")}} rule. Therefore the first item in the list of CSS rules will be a CSSImportRule.
@import "style.css" screen;
const myRules = document.styleSheets[0].cssRules;
console.log(myRules[0]); // A CSSImportRule instance object
{{Specifications}}
{{Compat}}