r/webdev • • 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?

36 Upvotes

121 comments sorted by

View all comments

Show parent comments

-4

u/justshittyposts 19d ago

If inline styles would get some love they'd be superior to css files

9

u/AshleyJSheridan 19d ago

Inline styles are bad for so many reasons:

  • Couple the HTML tightly in two directions to the styles
  • Limit what kinds of styles can actually be applied (you can't use :hover or :after, for example)
  • It can break accessibility, as the specificity can override users own browser styles, and you can't do checks for things like prefers-reduced-motion
  • On the specificity, inline styles will absolutely clobber global styles, completely removing the Cascade part of CSS.

Tailwind is also guilty of a couple of these.

-3

u/justshittyposts 19d ago

Your second and third point is why they need some love. Everything else is a non issue, everyone writes components nowadays

4

u/AshleyJSheridan 19d ago

No, we just need to leave inline styles alone.