Comment by lemagedurage
19 hours ago
Yeah, Tailwind is great as long as you have some way to reuse markup, like React. You don't have to care about class names and whether CSS defined somewhere else affects styles of a current component at all. That last point makes sense for LLMs as well: all the styles that affect the current file are automatically in context since styling is local. Admittedly, there are other ways to achieve this but the ergonomics of Tailwind are just good. Having nice defaults and good training data is an added bonus.
The lack of single-file components is one of several reasons I wouldn't reach for React prior to the LLM craze[0]. For personal projects, I love Svelte. You wouldn't need tailwind there for the reasons proposed given their support for it.
[0] Things have probably changed, but Svelte 5 was a litmus test for how recent the data cutoff was for an LLM model. Meanwhile React _especially_ has no reason to change how the framework is used by coders. Thus there's years of scraped tutorials and sites for how to throttle a function or what-have-you in React.