GeezerVison is showing developer.mozilla.org — CSSScopeRule - Web APIs | MDN
CSSScopeRule
Baseline 2025
Newly available
Since December 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Inherits properties from its ancestors CSSGroupingRule and CSSRule.
end Read only
-
Returns a string containing the value of the @scope at-rule's scope limit.
start Read only
-
Returns a string containing the value of the @scope at-rule's scope root.
Assuming the following is the only stylesheet attached to a document:
css
@scope (.outer) to (.inner) {
:scope {
background: yellow;
}
}
The following JavaScript could be used to access information about the contained @scope block:
js
const scopeBlock = document.styleSheets[0].cssRules[0];
console.log(scopeBlock.start); // Returns ".outer"
console.log(scopeBlock.end); // Returns ".inner"