Open this example in the interactive library
Source code
<div class="demo text-teal-700 [&_svg]:fill-current">
<svg aria-hidden="true" width="64" height="42">
<circle cx="20" cy="20" r="16" />
</svg>
SVG fill follows text
</div>
Set an SVG fill from the text colour with Tailwind CSS 4 utilities. The preview uses precompiled styles.
Open this example in the interactive library
<div class="demo text-teal-700 [&_svg]:fill-current">
<svg aria-hidden="true" width="64" height="42">
<circle cx="20" cy="20" r="16" />
</svg>
SVG fill follows text
</div>