8 ms·
What is it about everyone using Tailwind? It inevitably becomes a mess in every codebase I've used it in; it's like Perl, a write only language. I just use Van
by satvikpendem 4y ago
What is it about everyone using Tailwind? It inevitably becomes a mess in every codebase I've used it in; it's like Perl, a write only language.
I just use Vanilla Extract (with their Sprinkles API) and call it a day, it uses TypeScript as the preprocessor language and then compiles it to raw CSS, similar to SCSS but without writing SCSS.
https://vanilla-extract.style https://vanilla-extract.style
- sonicgear1 4y ago[flagged]
- satvikpendem 4y agoI see the Tailwind fans come out on any criticism of their library. I posted my comment a few minutes ago and already got a few combative comments almost immediately afterwards.
- antihero 4y agoYeah because you’ve jumped in on the attack on a post about something built with a tool that clearly gives a lot of people joy, in order to hawk your own thing. Getting whiny about people defending their own thing in response is kind of disingenuous. People got tired of vue people continuously doing the same thing about anything vaguely related to react, too.
- satvikpendem 4y agoNo, what I'm actually getting tired of is people getting on the hip new proprietary but trendy JS/CSS thing like Tailwind and leaving other devs to clean it up in a few years.
- antihero 4y agoAnd your Typescript CSS in JS thing using some new thing? TW is at least well documented and widely used and based on a fairly formalised bunch of classes that builds upon a concept that’s been used for 10+ years.
- satvikpendem 4y agoIt's not my thing, I didn't make it, for one. Then just use CSS at that point, it's been here 20+ years then. I simply don't understand how it can be superior to regular CSS in any way simply because it maps one to one onto CSS properties anyway.
- NayamAmarshe 4y ago> I simply don't understand how it can be superior to regular CSS in any way simply because it maps one to one onto CSS properties anyway. Could just read the docs. https://tailwindcss.com/docs/utility-first https://tailwindcss.com/docs/utility-first
- satvikpendem 4y agoI did, I even read Adam's initial post here on Hacker News itself. Just because they say it's better doesn't make it actually better. Indeed, to me, it is strictly worse.
- NayamAmarshe 4y ago> Just because they say it's better doesn't make it actually better. They didn't say it's better. They said go ahead and use it first, before pulling out opinions. I perfectly understand your position, I've been there too but it's a complete 180 experience after you build just 1 project with it. It's a "won't go back" experience.
- satvikpendem 4y agoI think you missed my previous comments saying how I've used it extensively the past few years for employers. It's like a bell curve, you like it and think, wow, this is amazing. Then as the years pass and you start having to maintain it, you steadily dislike it until you get to not wanting to use it anymore at all. The people who currently like Tailwind might simply not have gotten to this later stage yet.
- mort96 4y agoTailwind is under the MIT license. In what sense is it proprietary?
- satvikpendem 4y agoI should have meant proprietary as in non-standard, not non-open-source. By proprietary I meant that they wrote their own DSL and in the future if it needs to be ported over, it will be much harder. It's like CoffeeScript versus Javascript/TypeScript.
- mort96 4y agoSo it's a criticism which applies to literally every use of some library or framework to make writing web apps easier.
- satvikpendem 4y agoSure, you could see it that way. That's generally why I also don't use libraries that haven't shown themselves to be durable; I'll use React because it's ten years old and has enough support so that if people do decide to migrate later on (due to technological improvements à la jQuery to pure JS and TS), it's easy to do so, and it's why I don't use much newer libraries like Svelte or SolidJS.
- antihero 4y agoHow exactly do things get proven to be durable if people don't use them in the first place?
- satvikpendem 4y agoPeople can use them, I don't though.
- Aeolun 4y agoI think it’s interesting that just because you don’t like Tailwind, suddenly vanilla-extract and Typescript are trash. I wonder if there’s a correlation between people that like Tailwind and hate Typescript?
- trashburger 4y agoYou can criticize and explain what's wrong with it instead of insulting it.
- NayamAmarshe 4y ago[flagged]
- satvikpendem 4y agoUsing it wrong on every codebase that wasn't even made by me but instead by my employers? If it's happening that many times, the tool is to blame. More likely that the people who use it and like it (for now) have never have to handle large amounts of components and refactoring them. It's basically impossible. Trends come and go, who's to say that in a few years we decide, like jQuery, that hey, maybe this utility first approach isn't all that great? Yet at that point we'd have lots of legacy code to refactor, again just like jQuery.
- techpression 4y agoThen every conceivable tool is to blame, especially within computer science, they’re all definitely used wrong more often than not.
- satvikpendem 4y agoCorrect.
- mort96 4y agoWait are you now just conceding that your criticism of Tailwind has no merit and could be replaced by a generic "All software is bad" meme?
- satvikpendem 4y agoI am parodying the parent's broad over generalization of tools. Yes, by their logic, they would concede that all software is bad. That doesn't mean some tools aren't better or worse than others. Just because hammers have flaws doesn't mean I'd use a hammer to screw in a nail, even if some do.
- antihero 4y agoI’ve found what you said to be completely untrue unless you’re totally lazy. If you’re building up a bunch of components, the tailwind classes are mainly within the basic components. In the first example of vanilla extract, it uses exact px measurements which already demonstrates it’s not geared to solve one of the primary selling points of tailwind (using config as a constraint to reduce mental overhead when building things).
- satvikpendem 4y agoAnd have you had to work on hundreds of components that you had to refactor before? It's a write only language. > I’ve found what you said to be completely untrue unless you’re totally lazy. Ah yes, the laziness argument. Let's not blame our tools but ourselves for the tools are always good and righteous. If only those darn C programmers weren't so lazy writing their memory leaks.
- antihero 4y agoI have, yes. It’s fine and no more annoying than css, styled or whatever else. If anything it’s easier because there’s consistent and constrained bunch of classes you can use.
- satvikpendem 4y agoThen just use CSS at that point, since the classes literally just map onto CSS properties anyway (and sometimes not even, since they have to spend time to make new, or even older, rules work). That's what I don't get about Tailwind, at its best it's as good as CSS, but oftentimes stuff like SCSS, CSS-in-TS etc are simply better.
- dmitriid 4y ago> Then just use CSS at that point, since the classes literally just map onto CSS properties anyway CSS is definitely a write-only language. I've yet to see anyone understand CSS in a large system and refactor it. You end up with dozens and hundreds one-off classes and overrides everywhere.
- zmxz 4y agoIt doesn't become a mess, but it's interesting you chose to comment on Tailwind and not KonstaUI despite topic being KonstaUI. Do you have any opinion to share on KonstaUI or any other helpful insight, except giving yourself credit for what you use and being negative towards the rest?
- Semaphor 4y ago> on Tailwind and not KonstaUI despite topic being KonstaUI Eh, when the heading prominently mentions TailwindCSS, I’d say the topic is very much about that choice. If it were a minor implementation detail, it would be different.
- cageface 4y agoI’ve used Tailwind successfully on several large codebases. It’s the only approach to CSS I’ve used that didn’t make me hate styling HTML.
- satvikpendem 4y agoI've often found that people who are in the frontend don't properly learn CSS and just hack it together. That was me too for a long while which is why I hated it. Then I started learning it from first principles and it makes a lot of sense. Now I can build whatever I need in plain CSS classes.
- Kiro 4y agoSaying people use Tailwind because they don't know CSS well enough is simply untrue. I feel like you don't even want to understand why people actually like Tailwind. It's not like you arguing against it will make us stop using something we love.
- satvikpendem 4y agoLots of examples of it online of people using Tailwind because they don't know CSS well enough, it's not even debatable when they themselves literally claim that's why they use it. Even in this thread there are people doing so: https://news.ycombinator.com/item?id=34921960 https://news.ycombinator.com/item?id=34921960 I understand perfectly well why people like Tailwind. The problem is not initial productivity; indeed, I can write bash scripts too very quickly that make me feel infinitely productive. It's what comes afterwards, the maintenance, the teasing of code written, that Tailwind makes so difficult. And sure, use what you want, but I won't use it.
- twism 4y agoJust not possible to use tailwind without a really good grasp of css
- 4y ago
- phphphphp 4y agoI’ve recently started working on 2 legacy codebases, one with tailwind and one with scss. The #1 problem — that has cost me multiple hours! — is inheritance, because how developers write CSS and how business people think about design are very different. I constantly find myself causing side effects when making any change to the css, it’s a headache. I don’t think tailwind is perfect but coming into a well-established codebase I am so much happier to see tailwind. I can’t think of a single issue I’ve encountered with tailwind in this context. You can certainly write good, maintainable CSS and I’m sure tools like Vanilla Extract make it easier but to say tailwind is worse is just wrong (in my experience, anyway).
- satvikpendem 4y agoI work in React so all of our CSS is scoped, at the very least with CSS modules, so we never get to a point where we have global CSS, at all. If you're working on a project that uses global styles, then yes, it will be extremely painful. But in the days of components, Tailwind simply is worse to me from a maintainability perspective than just having scoped CSS. It is at best equal to CSS classes because inevitably the pattern used is with @apply or making a space separated string of all the Tailwind classes in JS in order to add that as a variable to whatever div you needed to. Which is, well, CSS classes reinvented.
- omnimus 4y agoAnd many people don't work in components or scoped CSS. Utility classes help so much in those cases. The only problem with tailwind is it goes super overboard with the idea. You want to use probably 30% of tailwind and use their naming convention. But once people start to write some long on demand single classes its always better just name a class and use CSS. I think its because the authors need to be seem they are making updates all the time and can't accept that it's pretty much finished project. They also don't want to accept that utility classes are not solution to everything and good old CSS still has lots of use.
- satvikpendem 4y ago
- silversmith 4y agoSometimes, write-only languages are okay. Landing pages, marketing materials that will be gone soon. Tailwind shines there. Web apps, not as much.
- satvikpendem 4y agoI used Tailwind on landing pages and marketing materials too, it was a pain to change things around even then. And as you say, it's especially worse with web apps, but apparently everyone wants to make UI toolkits with Tailwind as their base.
- deergomoo 4y ago> a write only language This is exactly the situation Tailwind prevents. Unless your team has incredible discipline, CSS across a large system very often becomes a tangled mess where you can’t change one thing without unintentionally affecting another. When you change the Tailwind classes on an element, you know there’s no risk of subtly breaking something somewhere else. Don’t conflate “visually busy” with “unmaintainable”.
- satvikpendem 4y agoIf you're using global CSS or BEM etc, you're right, Tailwind sounds like a dream. I work in React apps however where CSS modules or CSS-in-TS already solves the scoping problem for us. So now we're left with just the "visually busy" part that's unmaintainable and not better than CSS classes.