Hacker News new | ask | show | jobs
by pupppet 708 days ago
You lost me at ‘maintain’. It’s definitely not easier than just updating a single .button class, and I’m not going to create reusable components out of everything in my project, the <Button /> approach doesn’t work for everything.
2 comments

Yes, it is easier to maintain

(assuming no css-in-js) Your styles are bound to the component, not some global in your app.

States and their representations are controlled in the component themselves

With normal css files and class names, you must jump between files. With tailwind, I see what's going on with a component right in my jawascript

You’re assuming I’m going to create a component out of any element on the page that needs styling. In my project I could just have a small handful of these scattered across hundreds of files:

<table class=“datatable”>

If I used tailwind utility classes, how do I update my data table styling without having to search and replace across all of my files? Assuming you could even search and replace, the utility classes could be in a different order. Not saying it’s not doable, but it seems like a real pain in the ass. What am I missing?

The things it doesn't work for are the things that .button doesn't work for either.