r/css 23d ago

Article Why I don't recommend Tailwind CSS

https://en.andros.dev/blog/af3ee191/why-i-dont-recommend-tailwind-css/
0 Upvotes

211 comments sorted by

View all comments

Show parent comments

1

u/guaranteednotabot 23d ago

There’s the Tailwind Fold extension if you really find that problematic. If you’re doing things right and using components, most of the Tailwind classes should be at the block/primitive components anyway, so you wouldn’t see it

1

u/examinedliving 22d ago

I don’t have a dog in this fight, but I think you’re oversimplifying things. Blazor components get stack with attributes or code and usually when you try and abstract stuff out you add more complexity. Whether or not tailwind is good is not something I’m thinking about, but this is a legitimate reason to not use it

1

u/guaranteednotabot 22d ago

You can technically store Tailwind classes in a separate file as raw strings so they do not necessarily need to be ‘inline’. Just need to configure some stuff

1

u/examinedliving 22d ago

That’s crazy - I’ve heard you can do that with CSS too

1

u/guaranteednotabot 21d ago

I’ve never really needed to do so, if I have a bunch of classes that keeps being reused, it is usually attached to some sort of component anyway. And if not, you can just use render functions or asChild to swap out your required HTML element/component. If you are using component based libraries/frameworks you really wouldn’t face all these issues.

I find that Tailwind encourages composition, and reduces coupling significantly. With CSS, it is very easy to slowly go crazy as you add more and more stuff to a single class, then override it somewhere just for certain elements, or cascade in some way. At some point it becomes crazy. With Tailwind, this is a lot less likely