3 ms·
To start, it's ok to not like Tailwind. The author's complaints are valid in the sense that Tailwind doesn't really solve the edge-case problems they apparently
by iambateman 4y ago
To start, it's ok to not like Tailwind. The author's complaints are valid in the sense that Tailwind doesn't really solve the edge-case problems they apparently have.
But the author finishes by saying "Maybe you really want to avoid coming up with names." And yes, I really do want to avoid inventing names and I'll tell you why.
If I have two projects both written in Tailwind, it's trivial to switch between them and make confident adjustments. On the other hand, if I have two projects with `.btn.btn-small`, there could be an infinite number of parent styles affecting that button in unpredictable ways. I don't just need to understand what `.btn` and `.btn-small` do, I need to understand _all_ of the parent selectors which could affect that button. The moment you write the equivalent of `body.single-page .entry-content .btn.btn-small {}`, your code is essentially unmaintainable.
All abstractions are reductive – the mercator projection sucks compared to a three-dimensional globe – but some abstractions are useful and Tailwind is very, very useful to me.
- xkcd1963 4y agoWell you could also use atomic design, essentially writing the btn and pagestyling separately and hoping they wont interfere. Any tool will have a tradeoff.
- emmacharp 4y ago> `body.single-page .entry-content .btn.btn-small {}` But why would you do that? That's awful CSS. And nothing calls for it. There also are tools for linting and analyzing CSS that would flag this atrocity. Everything is there for us to use CSS in a good, simple way.