Open this example in the interactive library
Source code
<style>
:where(.demo p, .demo h3) {
color: #0f766e;
}
</style>
<div class="demo">
<h3>Heading</h3>
<p>Text at the same colour</p>
</div>
Keep grouped selectors at low specificity with native CSS. The preview includes a small shared demo stylesheet.
Open this example in the interactive library
<style>
:where(.demo p, .demo h3) {
color: #0f766e;
}
</style>
<div class="demo">
<h3>Heading</h3>
<p>Text at the same colour</p>
</div>