4 ms·
The bane of Tailwind is that to appreciate it, you should have in-depth experience with regular CSS. Negative opinions mostly come from people who show no under
by brachkow 2mo ago
The bane of Tailwind is that to appreciate it, you should have in-depth experience with regular CSS. Negative opinions mostly come from people who show no understanding of CSS and pre-existing methodologies of writing it at scale. This author, as all authors of similar articles, shows quite limited CSS knowledge, judging by his points.
Answering every point of the author:
1. You have to learn dozens of classes – these classes are named after dozens of CSS properties. So you already know them. You also take this knowledge to other projects that are using Tailwind.
2. It breaks the separation between structure and design. Also, in HTML, you put scripts and CSS into files by design. Separation is a made-up thing. And writing Tailwind with @apply is still a valid way to write it – you lose code size benefits, but design system enforcement stays.
3. Its names are not consistent. See https://wiki.csswg.org/ideas/mistakes/ https://wiki.csswg.org/ideas/mistakes/
4. The design system is not enforced as much as it seems – you can literally detect deviations from the design system by the [] pattern, and you can force it with linters.
5. It is not a good gateway to learning CSS – Why should it be? It's a framework, not a CSS learning resource. BTW, it is still a better way to learn CSS than with auto-scoping modules.
6. It is hard to read – The author neglects clsx that is the default/available way to write CSS in most frameworks, that allows to group classes via arrays and objects.
7. The HTML lies to you about priority – Cascade is way harder than the author thinks, and by the way, one of the selling points of Tailwind is what makes complex cascade situations completely avoidable. What if color-red and color-green are in separate unscoped modules bundled up by webpack?
8. Working with Dev Tools is not comfortable. Agree, but it's how browsers devtools work.
P.S. I write CSS by hand via BEM on my own projects, and use Tailwind when I work with frontend and design teams. BEM is great, but it is much harder to onboard engineers to a BEM codebase, and no-methodology is a disastrous approach that sinks many frontend projects in bloat and cascade hell. Tailwind makes everyone familiar with code, and also Tailwind keeps our agreements with the design team in code.