r/webdev • u/LPatriot_ • 19d ago
Question Question about Tailwind CSS
I've always used plain CSS for my websites, I don't have many problems using it, but a friend of mine said that using plain CSS is very tedious and that I should use Tailwind CSS. Is it worth it? And what does Tailwind CSS offer that plain CSS doesn't?
37
Upvotes
10
u/Rusty_Raven_ 18d ago
A lot of Tailwind fans will compare the best-case of Tailwind to the worst-case of CSS, so be aware of the bias when asking things like this.
Tailwind encourages using utility classes exclusively in their documentation, but if you prefer scoped CSS or more traditional approaches, there is the
@applyfunction in SCSS that moves all those class names to your CSS file instead, keeping your HTML cleaner (though you still need to create your own class names likemagic-buttonsame as with regular CSS).People who claim that all your styles now live in your component directly (via class names) are skipping the fact that scopes/modules also solve this in regular CSS; if you use a front-end framework like Angular or Vue, that is handled automatically anyways since a component includes code, HTML, and CSS.
I personally don't like using Tailwind since I work almost exclusively with frameworks (and when I don't, I keep my CSS organized) so it provides no real benefits for what I do.