@scope
Newly availableSince 202693% of users
Limits a group of rules to a subtree. Selectors inside the block only match descendants of the scoped root, so short class names stay local.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyModernIn every major browser since March 2026. Widely available around September 2028.
The old way and the modern waySee the snippet: Scoped styles without BEM naming →
Old way 8 lines
.card__title {
font-size: 1.25rem;
margin-bottom: 0.5rem;
}
.card__body {
color: #444;
}
/* HTML: class="card__title" */Modern 10 lines
@scope (.card) {
.title {
font-size: 1.25rem;
margin-bottom: 0.5rem;
}
.body {
color: #444;
}
}
/* HTML: class="card", class="title" */See how modern your own CSS is.Check your CSS →
Quick example
@scope (.card) {
.title {
font-size: 1.25rem;
}
.body {
color: #444;
}
}Related snippet
Scoped styles without BEM namingWorkflow →@scope browser support
BaselineNewly availableSince 2026 this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.Works in all modern browsers. May need a fallback for older browsers.
Usage93%of people can use this7% use a browser without it.
Browsers
118+
146+
26.4+
118+Mobile
118+Android
146+Android
26.4+iOS