Scoped CSS with @scope
@scope limits selectors to a part of the DOM without adding a namespace class to every selector.
@scope (.article) {
:scope {
container-type: inline-size;
}
a {
color: var(--article-link);
}
}
Scoping limits where selectors match; it is not style encapsulation. Inherited properties and custom properties can still cross the boundary.