Open this example in the interactive library
Source code
<div class="demo [:where(&)_p]:text-teal-700 [:where(&)_h3]:text-teal-700">
<h3>Heading</h3>
<p>Text at the same colour</p>
</div>
Keep grouped selectors at low specificity with Tailwind CSS 4 utilities. The preview uses precompiled styles.
Open this example in the interactive library
<div class="demo [:where(&)_p]:text-teal-700 [:where(&)_h3]:text-teal-700">
<h3>Heading</h3>
<p>Text at the same colour</p>
</div>