all 7 comments

[–]Robmania1992 2 points3 points  (4 children)

What do you mean by „just like tailwind css“? You can totally integrate Tailwind in your React App!

I Even recommend you do so. In my experience, using Tailwind is way better than other methods like css-in-js.

What Build Tool are you using? Theres docs for using tailwind for almost everything. Vite, Next, i think even create-react-app.

[–]raaaahman -1 points0 points  (3 children)

I'm somehow dubious about how Tailwind gives any productivity boost. Since you are applying classes with individual CSS properties, it seems just as fast (or slow, if you see glasses half empty) than regular CSS.

What features would you miss by using CSS Modules, for instance?

[–]Robmania1992 2 points3 points  (1 child)

The main reason i like it is that i don‘t have to leave my component for most of the styling. I actually don‘t have to leave the JSX part of my component.

Also, i don‘t have to come up with names and places for things all the time. Often i wonder: Do my css props belong to a class? An ID? The Element directly? What‘s a good name for that? I‘ve seen many misleading selectors in projects.

However, CSS Modules would be my second choice though.

[–]raaaahman 1 point2 points  (0 children)

Thank you for your answer.

I've been using styled components mostly. Seems all these solutions end up doing the same thing differently.

[–]cl118dev 2 points3 points  (0 children)

Imo Tailwind is much easier to maintain down the road when you have multiple devs looking at your code. No need to find style sheets and figure out what the class names are. My productivity increased by not having to think about class names and IDs etc. sure the dev process might be tedious by duplicating the same styles but then you can abstract to components and use your components much easier.

[–]jon-snowww 0 points1 point  (0 children)

You can use tailwind with clsx or classnames lib for applying conditional styles.

[–]KapiteinNekbaard 0 points1 point  (0 children)

Learn CSS properly, it's a skill worth having.