News for hackers. Stuff that matters.
Re:Reimagine Atomic CSS by echelon on Wednesday November 17, 2021 @01:01PM (#29256484)
I suppose in theory it gives you the ability to tweak all styles of a given type together in unison.

    .color-primary {
      color: #f00;
    }

Could easily become

    .color-primary {
      color: #00f;
    }

But beyond this case, I don't understand it either.

It feels like the gravity has moved a long way from CSS Zen Garden and that the web isn't about semantics and documents anymore since the practical usage differs.

Any designers that can shed light on this tailwind trend?

Re:Reimagine Atomic CSS by sodapopcan on Wednesday November 17, 2021 @01:19PM (#29256721)
You're not far off.

What people often miss is that this is to be used for creating design systems. `m-0` doesn't necessarily mean `margin is zero`, it means the smallest margin available. You should also call it `m-xs` for example. Or if it does mean margin is 0 then it might be better suited to be called `m-none`.

These utility classes play very nicely with component-based design. Just like JSX puts your markup in the same file as your code, this does the same for styling/layout.

I wouldn't say it's necessarily "better for all" but it's absolutely a very viable way to work no matter how much some may cry heresy. It saves you from having to figure out what you're going to call everything upfront and let's you break things into components as you go. I haven't personally use it on a big project but I've found it a very clean way to work and have heard good things from folks using it on big projects.

Re:Reimagine Atomic CSS by chrisweekly on Wednesday November 17, 2021 @03:21PM (#29258349)
> "the web isn't about semantics and documents anymore"

Bingo. The "documents" era of the web has given way to the "applications" era.

Re:Reimagine Atomic CSS by krsdcbl on Wednesday November 17, 2021 @01:35PM (#29256984)
That's the thing that speaks for tailwind with the swatch-like config, but applying this principle here would lead to utter chaos.

If i need a little more spacing on alk my medium margins, i would end up with something like .m-8 { margin: 10px; } if i start editing these compiled styles