style()
Limited availability0% of usersExperimental
A part of container queries that lets you style elements based on the computed value of a CSS property (usually a custom property) on their parent container, rather than just size.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyComingNot in yet, so not every major browser supports it.
See how modern your own CSS is.Check your CSS →
Quick example
/* Change theme based on parent's --theme variable */
@container style(--theme: dark) {
.card {
background: #222;
color: #fff;
}
}style() browser support
BaselineLimited availabilityThis feature is not Baseline because it does not work in some of the most widely-used browsers.Not ready for production without a fallback.
Usage0%of people can use this100% use a browser without it.
Interop 2026 focus area. All major browsers are actively working to fix cross-browser inconsistencies for this feature in 2026. Learn more →