3 ms·
There's definitely a subjective element to authoring CSS, so I'm glad people have options. That being said, one of the things Tailwind got right is that it's e
by iansinnott 3y ago
There's definitely a subjective element to authoring CSS, so I'm glad people have options.
That being said, one of the things Tailwind got right is that it's even faster to type out than normal CSS _or_ JS objects.
When you know what you want from Tailwind you write it and see it very quickly. Subjectively, there would have to be some very strong benefits to get me to go back to writing plain CSS rather than a bunch of class names.
- _heimdall 3y agoThis take varies greatly depending on the user's experience. I can knock out a responsive grid layout taking advantage of pseudo elements and :is() selectors quickly with CSS. Doing so with Tailwind is a nightmare for me, I end up searching docs for classes for every style I want and combinatorial classes for pseudo selectors will never click for me...why bother when simple things like spaces before a :has() selector or `margin-block` isn't even available?
- aabhay 3y agoThis is a… super niche case but if you insist, you can use the @apply syntax to use tailwind inside a css file to save time and typing. Then they have an extension for vscode that does autocomplete and shows you the css of each shortcut.
- _heimdall 3y agoIt may just be how I structure layouts, but in 10+ Tailwind projects I've worked on I've never been able to avoid escaping TW at times and using @apply or directly styling with CSS selectors. Some things just don't work well or at all in a class-based utility system. There's nothing wrong with that, but personally I'd rather stay with one styling paradigm and avoid having to decide when to break out of the "do everything in utility classes" model. The context switching isn't worth it for me and I still lose the benefit of colocation.
- iansinnott 3y agoAgreed that grid styling works better in plain CSS, but that's often only a small amount of the CSS a site needs in my experience. You can write grid in a normal class and then write all your other styles inline via classes. Best of both worlds IMO.