DEV Community

Discussion on: Is TailwindCSS Worth It?

Collapse
pixleight profile image
Chris Violette

I feel that recommending @apply directives for building all the styles is missing much of the point of Tailwind. Aside from constraining you to a theme to enforce consistency, that approach offers little advantage over vanilla CSS.

Where Tailwind shines is allowing for simple maintenance of styles self-contained within a component, without the need to hunt for it within a separate CSS file. Additionally, using the utility classes helps avoid unintended cascade or specificity issues.

I use @apply sparingly in my projects, reserving it primarily for styles frequently repeated in different places across the project, like a button. For something like a card in this post's example, I would almost always create a Card component and use Tailwind classes to style it.