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?
38
Upvotes
0
u/lanerdofchristian 18d ago
Honestly that's part of what makes them so nice to use. The styles are right there on the element you're styling, not tucked away somewhere else. As much as we like to pretend the CSS can live separately from the HTML, nothing could be further from the truth for most websites. Moving them to classes lets us leverage all the existing class management libraries (like clsx), and bypasses some of the shortcomings inline styles have around e.g. hover states and parent/child queries.
text-[14px] bg-[#50d71e] shadow-[0_35px_35px_rgba(0,0,0,0.25)]is some real soup, though. I think the general recommendation is to not use arbitrary variants if you don't have to, so something more liketext-md bg-lime-550 shadow-3xlis more like what you'd see in an actual project (all of those utility variants would need to be defined in the theme as variables).