News for hackers. Stuff that matters.
Re:Inline Scope for CSS by emmanueloga_ on Monday October 14, 2024 @03:04AM (#41834968)
> I really wouldn’t say Tailwind does anything that resembles living and breathing CSS.

@scope itself doesn't resemble traditional CSS. In fact, @scope is not even generally available, since FF doesn't implement it yet.

> Their entire value proposition is making shit copy and pastable by ignoring the “C” in CSS

The scoping problem in CSS is well-known, and one could argue that the "C" in CSS can often be one of its biggest flaws. Cascading is complex and hard to use. I like how @scope addresses this issue!

If you have the problem that @scope solves (and you'll have it if you write non-trivial webapp), and you want something that will work today across browsers, an alternative solution you should try is Tailwind.

> and then doing further things to kind of reduce how much you need to know about writing CSS

I've been thinking of TW as an "APL for CSS": it is this cool shorthand system where a bunch of little utility classes can generate a lot of CSS properties for you. But you still 100% need to understand what your shorthand is doing.

> Don’t get me wrong, I see the appeal of it, but the implementation I think leaves a lot to be desired.

No tool is perfect, but in my experience, Tailwind has made building complex web apps a lot more enjoyable.

> I know a lot of people like it but it’s considered a very flawed solution in a lot of ways by people who have a decent working knowledge of CSS to begin with.

I wasn’t swayed by the popularity of Tailwind or the opinions of CSS experts. I decided to form my own opinion, and I'm glad I did! (I was skeptical too for a long time).

I’m typically a late adopter—I prefer to wait until the rough edges of a tool have been smoothed out, but/and I've been using TW 4.0 (in alpha) for about three months, and even with a long career of writing CSS in more traditional way, and also things like Sass, CSS-in-JS, etc, etc, my current assessment is that TW is a more enjoyable way to write web apps.

--

Locality of behavior is the main thing that makes it so enjoyable for me. Things like shadow DOM and @scope are steps in that direction. Maybe someday newer web standards will make TW obsolete, but for now, it is my preferred way to style web apps.

There are no comments on this comment yet.