“Tailwind, and the death of web craftsmanship”

I’ve wondered too about the field’s refusal to reevaluate tech, sticking with ideas about CSS, HTML, and JS that haven’t been correct for a while now, and the lack of curiosity about the foundation we’re building on https://pdx.su/blog/2023-07-26-tailwind-and-the-death-of-craftsmanship/

Tailwind, and the death of web craftsmanship • pdx.su

The personal blog of software engineer Jeff Sandberg

@baldur I will never get past the whole value prop of Tailwind being "the cascade sucks"

@cferdinandi Yeah. There’s a lot about Tailwind that has perplexed me.

Like, they don’t want to learn one of the web’s core languages so their solution is to replace it with a poorly-specified, single-vendor ad hoc Domain-Specific Language that’s going to be at least as complicated as the thing it replaces?

Sounds half-baked from the get-go.

@baldur So much this. Utility classes absolutely have their place, but what they do is... no easier than just writing CSS.
@baldur As an aside: I really appreciate what you do for the web, Baldur! You're such a wonderful voice in the space!

@cferdinandi Thanks! I really do appreciate that. 👍

And, same to you 🙂

@baldur @cferdinandi I think there's a lot of "Web developers" who mean they do clientside JS, and view HTML/DOM and CSS as frustrating interfaces they have to go through, rather than the core ends that their SPA frameworks are simply a means to.

From that perspective, Tailwind is better because it's "less CSS" (or so they think).

The irony is that it requires a willingness to learn CSS to realise that Tailwind isn't doing much of anything for you.

@swift @baldur I'm imagining a bunch of carpenters who view themselves as "screw and wood constructors" and get annoyed at having to work with composites or nails.
@baldur I mean, I disagree completely, but I’m glad we all get to work with what we like working with and it all works on the open web.

@baldur I agree with all the CSS related stuff, but the component example plays in the same leage in HTML land as the author's critic in CSS land.

Just use `<button type="button">` instead of writing a custom `<Button>` component!

@raffael Yeah, the Vue button example in the post is a nope. 😬

@baldur I am no tailwind fan but for large codebase it has the merit of making your css codebase size grow logarithmically, whereas semantic approaches to managing css will be ever growing and we need to always go back to delete dead css code over time.

With that said I would never advocate for a team to adopt it. It is a tool that puts authoring before everything, and we read and debug code way more than we write it

@baldur As someone who used to write books about CSS, reading this was like trying to grasp an explanation about an alien concept. It’s so strange. (I still do the odd website. I’ve no doubt my code is archaic. But it’s clean and simple. What I see on most modern sites is anything but.)

@craiggrannell So, one of the things that the Tailwind community does get right, IMO, is that modern web dev is deeply dysfunctional (in their words "best practices don't work"). The problem is that they assumed they were somehow less dysfunctional than the rest, which they aren't.

Even the blog post I linked to, which makes some interesting points, has particularly poor examples. Using :is makes code needlessly indirect and opaque, for example, and using a div for a button is a huge error.

@craiggrannell Both of those could be replaced with examples that would be substantially easier to understand. Then add a few comments and you should have something that's broadly understandable to groups of people who have a wide variety of experiences in web dev.

This would also make teamwork easier, help training and recruitment, make bugs easier to spot and that way lower costs.

But the web dev goes the other way. They optimise for indirection and magic, most of it poorly undocumented

@craiggrannell It doesn't have to be this way. CSS can be written much more clearly, even using modern features. Some of those features even make clear CSS easier to accomplish. JS code doesn't have to look like the bastard child of Java and C++. HTML doesn't have to be an abyss of nested divs.

The field doesn't have to be this way but I don't know how to get there. 😐

@baldur Every time I now look at source code, it makes my eyes pop out. It’s just a mess of automated rubbish. My own stuff is far from perfect, and without doubt dated, but it’s at least simple.

It feels a lot like how game dev shifted from caring about every byte to not really giving a shit even about the odd GB, just because it could. The amount of wasted data and bandwidth these days is immense.

@craiggrannell and absolutely useless auto playing video as a background images @baldur
@mensrea @baldur Which is also an accessibility nightmare.
@craiggrannell Yup. Agree completely. It’s absolutely the same kind of shift.
@baldur tailwind is functionally no different from inline css except that inline css is simpler to implement and understand