DEV Community

Discussion on: TailwindCSS: Adds complexity, does nothing.

Collapse
 
kerryboyko profile image
Kerry Boyko

I briefly touch on the @apply directive in the article.

The thing about @apply is that you have this utility-class library that doesn't use semantic classes. @apply is then created to convert your utility-classes into something you can use in your semantic class.

Why not just write the semantic class in normal CSS and cut out the middleman. It's easier to read, more expressive, more powerful, and you don't have to learn a whole new syntax.

There is one particular case where @apply might be of use - and that's if a programmer knows Tailwind but doesn't know basic CSS... in which case I would not consider that programmer qualified to professionally write front-ends.

Collapse
 
alex_layne_3bbfe310a34ac7 profile image
Alex Layne

Because you can use variants defined in your Tailwind config and change them all just by changing the config. Duh. Your condescension is unearned when you couldn’t even figure that out.