@scope
HC · Modern CSSsyntax
@scope (.scope-root) to (.scope-limit) {
/* styles apply between root and limit */
}example
@scope (.card) to (.card-footer) {
p {
color: #374151;
line-height: 1.6;
}
a {
color: #2563eb;
text-decoration: underline;
}
}
/* The .card-footer and its contents are excluded */Note @scope limits where styles apply by defining both a root and an optional lower boundary. Styles only match elements between the root and the limit, not inside the limit. This provides true component scoping without build tools.