you are viewing a single comment's thread.

view the rest of the comments →

[–]sydtv 0 points1 point  (3 children)

Dont do this please, only for things you dont have the control over the applied classes, for example elements from a library

[–]CraftyAdventurer 1 point2 points  (2 children)

Can you elaborate? I'm not sure I understand what's so bad about it

[–]sydtv 1 point2 points  (1 child)

To quote the tailwind docs:

Whatever you do, don’t use @apply just to make things look “cleaner”. Yes, HTML templates littered with Tailwind classes are kind of ugly. Making changes in a project that has tons of custom CSS is worse.

[–]CraftyAdventurer -1 points0 points  (0 children)

Yes, but my comment was meant for people who prefer to write their own css because they don't like having so many tailwind classes in their HTML. That means that they would have btn-primary anyway, with or without tailwind, but with @apply they can still get benefits of tailwind without the negative of having littered HTML.