Live data from Hacker News

Tailwind is a leaky abstraction

jakelazaroff.com

11–20 of 391 posts

Re: Tailwind is a leaky abstraction

#11
post #6

Tailwind has made building components in React an absolute joy for me. I don't need to scroll up to find my css-in-js definitions, I don't need to change windows to find the CSS modules, it's all there, in one place.

[deleted]

Re: Tailwind is a leaky abstraction

#12
The first example provided of building a custom animation is already outside of Tailwind's core use case of rapidly building common UI while only having to look at the markup. The occasional fine-tuning is usually when it's time to step over to your CSS file and write a custom component.

Anyone who builds UI for a living, ideally already having a well-developed mental model for how CSS works, immediately understands Tailwind's power in my opinion. Anything merits critique but this article just feels like rationalizing a preexisting bias.

Re: Tailwind is a leaky abstraction

#13
It's so leaky that I have to constantly think about the thing it's supposed to abstract away.

For most of the work a frontend dev does Tailwind is just a nice shorthand library that makes life a bit easier for basic stuff. In that regard it's no different to Bootstrap, Bulma, Skeleton, etc. If you want to use it for absolutely everything, and you expect it to have every possible design element included, then you'll be disappointed. Just like you will with every other library.

90% of the time the abstraction works nicely. You can think in CSS and mentally convert to Tailwind pretty easily, or you can just learn Tailwind and occasionally have to delve into the docs when you're using quite niche styling.

It's not perfect, but that's not a reasonable criticism. No library is.

Re: Tailwind is a leaky abstraction

#14
Is making a CSS abstraction the primary goal of tailwind? With my limited understanding, isn’t the main point to use a compact DSL to stop separating style into a different file, therefor ending the scourge of ever-growing stylesheets?

No abstraction is going to address 100% of the underlying concept, but that doesn’t mean it’s not useful. I’m on a team that is currently fawning over Tailwind. I am extremely skeptical, but they really like the idea of being able to wholesale delete legacy styles, and they like the idea of not having to learn all the intricacies of some css oddities.

Tailwind reminds me of Coffeescript: embraced as a language until ECMAscript woke up and started fixing some of the languages deficiencies.

I am skeptical of Tailwind. Personally I wouldn’t use it over vanilla CSS, but it’s gotta be solving some problem to be as popular as it is. I think that problem is that CSS kinda sucks to learn.

Re: Tailwind is a leaky abstraction

#16
I don't think tailwind is built to solve the issue that the author is trying to fix. Tailwind provides a way to generate a set of consistent classes.

Instead of defining rules in style sheets they're associated directly to the element, which reduces the issue of having styles cascade all the way down.

The way people maintain CSS in ".css files" is really broken. Whenever something need to change quickly, a rule is appended with !important;

Tailwind introduces an approach that fixes that.

Post reply on HN