5 ms·
People make a bunch of excuses for Tailwind. If you're going to write CSS just write CSS. Stop coping.
by deprecative 3y ago
People make a bunch of excuses for Tailwind. If you're going to write CSS just write CSS. Stop coping.
- truckerbill 3y ago"If you're going to write assembly just write assembly."
- mcluck 3y agoThe difference is that high level languages actually bring a level of abstraction not present in assembly. Tailwind does not exist on a higher level of abstraction. It's at the same level but written in a different vernacular
- moritzwarhier 3y agoI think the word "coping" is inappropriate here, it's a tradeoff and in addition a matter of preference. You might like not having 24000 permutations of display: flex; align-items: center; in your code. There are good alternatives to Tailwind and also small projects where "just write CSS" is enough. In larger projects, most people need at least strong naming conventions, other tools, and/or an opinionated "template" such as Bootstrap. Many people using Bootstrap don't even bother to configure a theme. That's where the real specificity wars begin then (not necessarily applicable to you). And once people have started to define their design system in terms of overrides, pain is ahead (if you need any non-trivial CSS, that is). After switching jobs, I now mainly use CSS-in-JS (which frees me of many problems, and in my case, creates fewer other problems). I am perfectly versed in Vanilla CSS and the cascade, wrote my first stylesheet around 20 years ago (when layout in CSS was not really a thing) Why is doing things differently from your preference "coping"?
- dbbk 3y agoI would much prefer the explicit, vertically-legible, autocompletable and real CSS rules to a horizontal mishmash of proprietary aliases.
- moritzwarhier 3y agoI'm not even disagreeing with that. I saw the tradeoffs of Tailwind too. And yes, I also agree with the core of your critique: Tailwind is a (yet another) DSL on top of CSS, which makes it smelly. But as I see it, the reason for using Tailwind is not that this DSL was easier, in fact it's the opposite, I constantly had to use IDE autocomplete and/or the docs in order to use it. Tailwind is a nasty DSL inside the class attribute, yes. And still, this DSL can be and often is a relieve from other custom CSS that grows exponentially and causes bugs due to selector complexity. Tailwind IMO solves the same problem that styled-components, CSS Modules and ShadowDOM try to solve.
- dbbk 3y agoI've been using Styled Components exclusively for years and have no issues with selector complexity.
- moritzwarhier 3y agoI am using Styled Components as well in my current job and like it a lot. Maybe my post didn't make this clear, but that's what I meant when I said it solves the same problem for me. No dead styles, no specificity wars, no naming worries. Edit: I see, I wrote "try to solve" in contrast to "solve". That was unintentional and thus not what I wanted to say.
- deprecative 3y ago> Why is doing things differently from your preference "coping"? It's not. > There are good alternatives to Tailwind Yes, just write the CSS. If you are going to use Tailwind, just write CSS. If you are going to use Bootstrap or any of those sorts of resources the equation is different. You're no longer writing CSS in a class attribute but pretending it's a style tag and that you're somehow doing things "better". You're just writing CSS without writing CSS.