concept
scoping-proximity — CSS reference
If competing declarations reach this tie-breaker, the one whose scope root is fewer ancestor hops away wins. An unscoped rule has no finite scope distance. Higher specificity still wins earlier in the cascade. The selector in the @scope prelude is not counted toward the inner rule’s specificity.
Formal Syntax & Structure
css syntaxcss
@scope (.inner) { p { color: teal; } }Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS reference lab</title><style>@scope (.inner) {p {color:#006050}} @scope (.outer) {p {color:#802020} #b {color:#184168}}</style><body><div class="outer"><div class="inner"><p id="a">Near scope</p><p id="b">Specificity first</p></div></div></body></html>