Hacker News new | ask | show | jobs
by jumploops 327 days ago
I hated Tailwind when I first used it.

> (Tailwind) demands the developer who installs it set up a config file that lays out all codebase-wide style constants

> I believe this is where Tailwind has succeeded and other libraries have struggled.

This isn't why Tailwind has "succeeded," in my experience.

Until Sonnet 3.5, LLMs were pretty awful at creating any sort of UI with normal CSS, but were partially usable with Tailwind due to the colocation of styles with elements. Even with Sonnet 3.5+, Tailwind seems to perform better than other CSS solutions (though the gap is getting smaller with each new model release).

The author calls this out, but with the wrong conclusion:

> Lastly, Tailwind has also been buoyed by being by being the default styling that just about any LLM or vibe coding tool will produce [..] Plenty of developers started using jQuery because the first StackOverflow result in their search explained how to solve that problem with jQuery.

Maybe the reason jQuery was so popular wasn't due to recommendations on StackOverflow, but it's prevalence on StackOverflow was due how easy it was to adopt?

Tailwind has "succeeded" for the same reasons it's excelled with LLMs:

- colocation of styles with elements

- decent defaults (i.e. bg-sky-600, font-bold)

- simple solutions to common challenges:

  - responsive design (lg:flex-row) 
 
  - dark mode (dark:text-white)
 
  - conditional state (hover:bg-red-600 focus:outline-violet-500
Obviously, Tailwind, just like other CSS-in-JS solutions has it's problems/limits, but it's easy enough to fall back to normal CSS for these one-off solutions.

I now use Tailwind everyday, and it's no longer the worst thing in the world.

1 comments

I think I’ll take another jab at this part

> Lastly, Tailwind has also been buoyed by being by being the default styling that just about any LLM or vibe coding tool will produce

Tailwind, afaik, was doing just fine without LLMs “buoying” it - I’ve been using it for several years now and have been pretty pro-Tailwind since getting the hang of it, and it was rare to move to a new project that wasn’t already using it. The idea that LLMs are making it more popular is interesting but I don’t think Tailwind is a ship that would have sunk without them, on the contrary I think it’s been a solid choice for a while now for a lot of good reasons.