Live data from Hacker News

Tailwind is a leaky abstraction

jakelazaroff.com

61–70 of 391 posts

Re: Tailwind is a leaky abstraction

#62
post #3

Tailwind is not an abstraction, it's shorthand. It saves you several bytes in the source, saves seconds of typing, and in return rewards you with a massive headache.

I don't think that's true, just by importing the tailwind u add more bytes than plain css which you will end up writing.

Re: Tailwind is a leaky abstraction

#63
post #40

Tailwind is 100% an antipattern, spitting in the face of well-written CSS. It is essentially a crystallization of the 'utility class abuse' anti-pattern. There is already a well-defined way to write CSS inline, no need to obscure it with 'helpful' utility classes... right? In reality, I don't think that's necessarily a bad thing. When Rails came out, people ranted about how PHP was bad practices because it mixed disp…

>Tailwind is for people who don't want to learn CSS

This reveals a fundamental misunderstanding on your part about Tailwind. Tailwind classes map very directly onto CSS properties. You can't use Tailwind effectively without knowing about the corresponding CSS ideas (although you can be unaware of how exactly to apply them in pure CSS).

Rather, tailwind is for people who don't want to _use_ CSS as it was intended to be used. Named classes and stylesheets just don't mesh with how my brain processes these things.

Re: Tailwind is a leaky abstraction

#64
There's been some criticisms of tailwind over the years now that I've largely agreed with, but this one feels a little hollow. The point isn't to abstract away CSS. And the presences of escape hatches (above all being: *just use css, it's supported, well*!), is not a downside of tailwind, but one of its biggest strengths.

Re: Tailwind is a leaky abstraction

#67

Earlier quoted context omitted.

What would be the difference?

Performance, brevity. TW classes are a lot more concise and provide a "design system" vs raw values and browsers are good at applying classes vs parsing inline styles for every element.

I am really curious about the performance claim.

It seems to be mostly a matter of where the performance penalty is paid.

Browsers either parse CSS (mostly) "ahead" of HTML (tailwind CSS classes), or as they parse HTML (inline CSS): they still got to parse a very similar amount of CSS, except if you've got the same "rule" applied in a number of places (though in that case, element-based CSS rules probably win-out).

Do you perhaps know of any benchmarks where the actual real-world effect is visible?

Re: Tailwind is a leaky abstraction

#68
post #41

I don’t think the author understands why people like TailwindCSS. It actually removes a lot of abstraction layers away from front end development. I just wish they stop adding so much to it that it becomes bloated. Keep it simple.

I don't think the author can stop. I think it's a business now. It's going to continue on and on. It suspect it will follow every other frontend library with major version changes etc.

Re: Tailwind is a leaky abstraction

#69
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.

But you still have to have a config file, right? And the Tailwind docs. And then keeping track of when you changed something in your config that means the docs don’t apply 100%.

Re: Tailwind is a leaky abstraction

#70
Tailwind is absolutely awesome if you're creating JS components, and if you're doing that I have no idea how you could think it wasn't the best solution save for just not having ever used it properly. I can't see myself ever switching from Tailwind, it's the final form of css for modern front end development.
Post reply on HN