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.
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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.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.