News for hackers. Stuff that matters.
Re:Vanilla JavaScript support for Tailwind Plus by AstroBen on Saturday July 26, 2025 @12:23AM (#44691311)
This is one of the least elegant ways to scope CSS though.. you may as well just write inline CSS

I like BEM personally. "navbar__item" scopes the styling to the nav item

> Once you're well familiar with your toolset, you know what to reach for to quickly reach a desired end state

This also applies to plain CSS, doesn't it?

The big value add that Tailwind brought isn't their utility classes IMO - it's their philosophy around having a design system of consistent coloring and spacing. I actually borrowed that for my own projects. It taught me to be a lot more diligent about specifying the system upfront. Put it in CSS variables and re-use those

Re:Vanilla JavaScript support for Tailwind Plus by omnimus on Saturday July 26, 2025 @04:04AM (#44692314)
You can’t use inline css its not at all the same.

Inline css

1. Can’t use media queries (responsive design).

2. Gets you to specificity hell.

3. Does not follow any system or reuse of values.

4. Values can’t be centrally changed. Utility clases are still classes - when you change config to make color different it changes everywhere.

5. Its verbose. Utility class can have multiple css rules.

Conceptually it might seem that inline css is similar but thats just feeling. Functional css (utility classes) are about composing classes with simpler (one purpose) behaviour together to create complex behaviour.

Re:Vanilla JavaScript support for Tailwind Plus by troupo on Saturday July 26, 2025 @06:14AM (#44692901)
> Values can’t be centrally changed.

Or you end up redefining dozens of CSS variables inline :)