files/en-us/web/api/cssscoperule/index.md
{{ APIRef("CSSOM") }}
The CSSScopeRule interface of the CSS Object Model represents a CSS {{CSSxRef("@scope")}} at-rule.
{{InheritanceDiagram}}
Inherits properties from its ancestors {{domxref("CSSGroupingRule")}} and {{domxref("CSSRule")}}.
@scope at-rule's scope limit.@scope at-rule's scope root.Inherits methods from its ancestors {{domxref("CSSGroupingRule")}} and {{domxref("CSSRule")}}.
Assuming the following is the only stylesheet attached to a document:
@scope (.outer) to (.inner) {
:scope {
background: yellow;
}
}
The following JavaScript could be used to access information about the contained @scope block:
const scopeBlock = document.styleSheets[0].cssRules[0];
console.log(scopeBlock.start); // Returns ".outer"
console.log(scopeBlock.end); // Returns ".inner"
{{Specifications}}
{{Compat}}