Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Less wont apply Tailwind CSS classname with dot (.)

How to apply a Tailwind CSS classname that includes a dot with Less? Escaping (\) didn't worked. I can use this code without any problems in Sass:

@apply py-0.5;

Syntax error: The 0.5 class does not exist. If you're sure that 0.5 exists, make sure that any @import statements are being properly processed before Tailwind CSS sees your CSS, as @apply can only be used for classes in the same CSS tree. (7:4)

Other Tailwind CSS classnames just work fine.

like image 539
klabak Avatar asked Oct 31 '25 08:10

klabak


1 Answers

This is most likely related to how Less parses the input. You could use ~ to escape the class name.

@apply ~"py-0.5";
like image 50
juliomalves Avatar answered Nov 02 '25 18:11

juliomalves



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!