DEV Community

Discussion on: Tailwind class madness. Never again?!

Collapse
 
lukasborawski profile image
Lukas Borawski

Wait. This is great, but you're writing here your own, regular classes (assume that on top of BEM) and CSS. This is something different. The tools was created to avoid mass with the Tailwind utility classes.

Collapse
 
pcjmfranken profile image
Peter Franken

Time for some global, reusable components like buttons. And here we go... 🤕 Tailwind utility classes madness. To define a simple button I had to use like a' twenty-plus classes.

What I was trying to convey is that you haven't actually solved the underlying problem statement from your original post, only repackaged it. The long list of classes is still there, just moved elsewhere by this additional piece of code that you now also get to maintain.

That CSS snippet I posted is the output of your Tailwind button classes taken straight off the Tailwind docs. Same outcome for less effort and unbeatable performance, and most of Tailwind's utility classes map one-on-one with CSS properties anyway.

Thread Thread
 
lukasborawski profile image
Lukas Borawski • Edited

Well. You can look at it that way. But as I'm using a set of utility classes anyway and I want to use them globally, create one source of truth of my UI and not struggle with the messy templates I can set one place where I'm defining my variants and use them across the app.