Live data from Hacker News

Tailwind is a leaky abstraction

jakelazaroff.com

41–50 of 391 posts

Re: Tailwind is a leaky abstraction

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

Re: Tailwind is a leaky abstraction

#42
I think I could find annoyances of similar degree for every styling framework I worked with. I will still take that over not using these tools at all and reinventing them myself (as long as the tool offers an escape hatch).

Re: Tailwind is a leaky abstraction

#45
post #33
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.

After trying out Tailwind in one pet project I have to say that for larger teams it should not be used. Looking at the code now I get the feeling that maintenance would be a big problem. A bigger project with multiple pages having full on Tailwind css classes peppered everywhere looks to be a nightmare. Does anyone have experience jumping into an existing larger project with legacy tailwind all over the place? Would…

I think the key with Tailwind is that you need to aggressively componentize for it to be useful. If your pages are 90% made up of small components than it can be very reasonable and pleasant to work with. If you have a lot of pages that define their own HTML it can turn into a mess very quickly.

Re: Tailwind is a leaky abstraction

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

Tailwind-Remix is my jam.

Re: Tailwind is a leaky abstraction

#47
These are fairly complex use-cases that aren't needed for 99.9% of CSS people write. In most cases I'm throwing together a handful of components in a flex container or right-aligning some buttons or something.

And for that typical CSS usecase, I find Tailwind way better both for quickly iterating and for hopping into code someone else wrote. I love not having to bounce between and cross-reference 2 (or more!) files (HTML + CSS) for a description of a single layout.

I started using Tailwind at my job I started 2.5 years ago and after the learning curve of memorizing the commonly used class names I have yet to run into a situation where I wished we weren't using it. I also started adopting it in all my personal projects because it makes me so much faster at getting work done and the code is easier to maintain.

I really feel like people start with their conclusion that they don't like it because it's weird and foreign and then look for excuses to justify why they think it's bad.

Re: Tailwind is a leaky abstraction

#49
I wish someone would read the original article about "leaky abstraction" and then use the term correctly.

The author looks more like: I heard leaky abstraction, tailwind is an abstraction, therefor it is leaky. Then shows "problems" with Tailwind (tailwind wasn't supposed to solve) that are not leaky.

Also several of the commentators here misunderstand leaky abstraction

"This is what I call a leaky abstraction. TCP attempts to provide a complete abstraction of an underlying unreliable network, but sometimes, the network leaks through the abstraction and you feel the things that the abstraction can’t quite protect you from."

Re: Tailwind is a leaky abstraction

#50
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'm a tailwind fiend, ie I like tailwind, but I can say it won't save bytes in the source if you use it the way that the docs intend. Tailwind is not very DRY so you'll probably end up repeating classes in source resulting in extra bytes if you just used a custom class repeated on similar components.
Post reply on HN