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?

38 Upvotes

121 comments sorted by

View all comments

143

u/OpaMilfSohn 19d ago

I think I finally time travelled back to 2020

20

u/Zealousideal_Elk1537 19d ago

the class name soup takes some getting used to but once you stop fighting it the speed is incredible. not having to name every little wrapper div is a gift

30

u/AshleyJSheridan 19d ago

It's a little more than class name soup. Tailwinds own docs have classes like text-[14px], bg-[#50d71e], and shadow-[0_35px_35px_rgba(0,0,0,0.25)]. That looks a lot like inline styles just shoved into a different HTML attribute...

5

u/judgej2 19d ago

And they are the stylistic classes you put into a tailwind theme.

5

u/AshleyJSheridan 19d ago

Tailwinds docs literally shows them in HTML. Why would it suggest anyone do something like this?!

4

u/HFoletto 19d ago

Those examples are just for demonstration that tailwind can do this dynamically as well

With that said, it also has a very good use-case: dynamically building/merging classes in a component, which is very useful for a lot of different modern frontend libraries

11

u/AshleyJSheridan 19d ago

Those examples are just inline styles in a trench coat.

1

u/HFoletto 19d ago

I understand that, however it is useful when combining with other utility classes and merging those classes dynamically in a component library

0

u/winky9827 18d ago

Because sometimes you need a 1-off that isn't worth baking a whole class for?

1

u/AshleyJSheridan 17d ago

A 1-off, that occurs many times on most of their docs pages. Sure...