Using windicss with vuejs project, I found that its generating font-sizes as rem unit. e.g.
<div class="text-sm">Test</div>
generating css as
.text-sm {
font-size: .875rem;
line-height: 1.25rem;
}
Is there any way to generate sizes as em? so font-size: .875em
There could be a few ways (manually extending spacing to use
emor creating a variant to apply to convertremtoem).For the latter, you can check out this Tailwind GitHub issue.
https://github.com/tailwindlabs/tailwindcss/discussions/3105
Demo: https://play.tailwindcss.com/XFYT5WFump
(Not mine but in the github issue)
The usage of the plugin is
, which generates following output,
and the code for the plugin is,
I also created a similar ("unmaintained" for now) plugin a while ago,
https://github.com/downwindcss/variant-units
so if you want to support other units, you can check it out.