top | item 38112536

(no title)

i0nutzb | 2 years ago

Back in the day we made fun of this nonsense, now we freakin glorify it with libraries like Tailwind & friends...

discuss

order

threatofrain|2 years ago

CSS is one of the places in web dev that never really reached consensus, even today. We might get WASM as the app platform of the web before this even happens.

eternityforest|2 years ago

WASM is more of the same exact issue... web devs inventing fragmentation and trying to make things low level again even though they have such a great platform that's already batteries included...

matheusmoreira|2 years ago

Yeah. It's essentially a less verbose form of per-element style="..." attributes. It's weird to me that this is considered the state of the art today.

peebeebee|2 years ago

While I don't really like it myself, Tailwind is a good CSS framework for the age of component-based application design, where your JS / CSS / HTML lives in a single file, and your application-design won't change that heavily.

But when you want to redesign a whole site after the fact, or if you want to keep your component library logic & templates, and port it to a new system, Tailwind might be more trouble than it's worth.

It's just that... Atomic CSS has its benefits, BEM has its benefits, etc etc etc.

BasilPH|2 years ago

Why do you feel it's nonsense? I'm genuinely curios.

Personally I'm using Tailwind for 90% of the styling. If I keep repeating a certain combination of classes often, I'll group it with a custom class. (Edit: See colejohnson66's comment for an example)

Two advantages of tailwind that I didn't see before I started using it:

- It's often easier to find what I want in the tailwind documentation, and it comes with nice examples. MDN is great, but with Tailwind I get reasonable presets.

- TailwindUI: Saves me a lot of time and looks good without feeling as generic as bootstrap.

nicbou|2 years ago

Perhaps I'm just old-fashioned but I prefer semantic classes.

I completely rewrote the CSS for my website and I did not need to touch the templates. An .error is an error and a . collapsible is a collapsible. Their exact style is not dictated by the markup.

I also like that it keeps the markup small and easy to read, because it's not peppered with CSS.

It also avoids situations where two widgets look different because I forgot to copy one class over. A .collapsible is a collapsible.

naet|2 years ago

Tailwind is one of those polarizing topics where people either love it or hate it. I've used it at a few companies and I didn't care much for it, but I had coworkers who swore by it.

hipadev23|2 years ago

My gripe with Tailwind is the redundancy of class definitions across elements that clearly would benefit from "normal" CSS. If I have a <table> with a whole host of <td> elements, those repeated class definitions become quite tedious.

satvikpendem|2 years ago

At a certain scale, Tailwind becomes a write-only DSL. It's almost inscrutable if you want to change something on some heavily classed HTML tag.