Isn't the point of a library like tailwind that you don't need an AI assistant??? Sorry for the ghlibbesh comment but if you're summoning AI then why use tailwind? Just use regular.
Well, the last guy I've seen to use tailwand applied 15+ CSS classes to a div for styling. I don't know how he did it without AI, as the applied classes were not describing in any way IMHO.
probably AI solves that for you, by generating another 50 classes and applying even more to your n levels of nested divs.
Surely I'm not the only one who finds tailwind insanely easy to use, but I see so many people bashing it every day it baffles me.
Who cares if a div has 15 classes? When writing React, I spend pretty minimal effort creating, debugging, or modifying TW classes, especially when using `classNames` so I can break them into logical chunks. The hardest part is... oh, I get it.
The hardest part is when other people do a shit job of organizing their classes and I have to dig through them. But an LLM isn't going to solve that problem, only an actual, intelligent algorithm to standardize class arrangement would help, like prettier for tailwind classes.
> Surely I'm not the only one who finds tailwind insanely easy to use
It's a write-only DSL for CSS, easy to write but hard to then read and edit afterwards, which is a problem that you're blaming on a skill issue while it's a problem inherent to Tailwind's philosophy itself. Just use CSS Modules at that point.
I never understood this sentiment. Once you get past a dozen or two dozen classes being used all over your codebase, CSS becomes the write-only language to me. I don't know where this class is being used, so I won't edit it. With tailwind, I can see every style and I know exactly where it's going to be applied (to the element it's on). I find it much easier to read.
For sure, but they're talking about CSS modules, where styles are isolated to components at build time.
CSS modules are critical in a large web app for those rare styles you can't accomplish with Tailwind, but for the vast majority of styles I do not want to be hand-writing them. Plus, unless you're extremely strict about using CSS modules, you don't escape the horror of styles being inherited from global classes - on the other hand, a robust library of utility classes like Tailwind makes "inline" styling so easy you're likely to end up with almost no hand-written CSS anywhere.
No I'm not, I'm blaming it on the lack of organizational framework. I expect people to leave a mess if there's no guideline; there are more ways to do a thing wrong than to do it right.
> hard to then read and edit afterwards
No, that's what I'm saying. It's quite easy to read and edit - when organized. Maybe I'm the first person to invent conceptual organization of utility classes?? In which case I ought to just make a plugin for it.
Also, Tailwind has first-class support for grouping utility classes, such that `.button` can apply 15 different styles at once if that's your preference. So, you know, the exact same as regular CSS.
I tried, but it's not for me. I found myself proud of styling a button, before noticing that I spent an hour. A lot of classes are almost plain Css attributes, so you just ask yourself "why am I doing this instead of writting the Css myself, like in the old days?" It's a tell that people is making money by creating a new Bootstrap on top of Tailwind, and calling it "components". Or AI assistants.
It isnt harder than applying one class where you set 15 different things. Only difference is you dont need to spend time naming stuff and you dont need to click to another file to see the styling applied.
There's a massive pile of options for writing styles in the same file as the JS. Naming stuff isn't hard when you use CSS modules. Learning and memorizing the Tailwind DSL takes just as much time as it takes to learn basic CSS.
Do what you want but I honestly don't understand why anyone who already knows how to write CSS would use Tailwind
Mainly if you use Tailwind already, and need help making designs or components. As to why use Tailwind... well that is a big topic. But my favourite thing is easy tweaking of a specific component or page without affecting things globally, making those tweaks in the same place as the definitions of the tags for a component, and being able to copy ideas from elsewhere and have them appear as-is without getting "styled" by other things in the CSS bundle (or browser defaults).
One of the things that makes LLMs challenging to use with codebases is needing to pull in context from a large amount of different files and make edits across multiple files. Because an LLM will likely already know tailwind, you can just pass in the full text of the one component to alter without needing to also pass in one or more css/scss files as well.