DEV Community

Discussion on: Why Tailwind? A long term user perspective

Collapse
 
ecklf profile image
Florentin / 珞辰

The problem is, that's not an improvement on how people do CSS in the first place, and it's also not how people use Tailwind in the real world.

I do agree @apply gets rid of the benefits, and this is why you should avoid using it. It is openly discouraged to be used by the author. However, it comes quite in handy when you need to style something globally.

Collapse
 
king11 profile image
Lakshya Singh

I actually use @apply under two situations when I don't want people to easily copy of my design from just looking at HTML and second when I have conditions like the one Adam showed related to lists of similar element. I would probably make a new component and then apply scoped css using selectors on it with @apply this prevents the bloated HTML. I am doubtful though whether HTML vs @apply which one will bloat my css.