Hacker News new | ask | show | jobs
by rgbjoy 886 days ago
So am I the only person seeing htmx and tailwind together and feeling absolutely disgusted? Like a wall of run on sentences and no paragraphs. I can’t believe tailwind is a thing…
13 comments

The love for tailwind might be explained as mass psychosis.

It's like the coding version of https://en.wikipedia.org/wiki/Dancing_mania

No, it's a hatred of CSS. CSS is a pain, tailwind is a balm. I use tailwind on everything, extend or modify tailwind as needed, and write very little CSS. I have also stopped having dreams of strangling css-grids to death since I started doing this, so something's working.
Sounds like you just don't know modern CSS. I rarely have trouble styling things how I want these days.
Unfortunately, I do. Modern CSS is not modern SASS.
I'm not familiar with modern Sass. Has it evolved much in the last decade? I'm still using Less because I installed it 10 years ago and it still works great, but there's almost 0 features that haven't been adopted into CSS now so I really don't need at all.

There is 1 I guess. I wrote a loop somewhat recently because there doesn't appear to be a variable for DPI yet. `env(dpi)` doesn't exist or I could have did what I wanted: scale a <canvas> element to be 1.0 scaling regardless of the user's screen scaling.

Have you tried https://open-props.style/ ? Atomic CSS but leverages good CSS principles.
I have personally never seen a easier way to style things than the modern css engine. Whether its Android, iOS, GTK or anything else. CSS is fast and extremely easy. Used to flexboxes in css. Goodluck enjoying others :)
The engine is good, the language is not. Tailwind is an abstraction layer removing much of the pain from the engine.
I dunno. I've always absolutely hated jumping around CSS styles, tailwind has got me actually making nice UIs.
When I first encountered Tailwind, I sincerely thought it was satire—that its authors were making a really clever and elaborate joke about the state of front-end dev.

Then, I encountered the raving fans. That's when I knew the shark had been jumped.

I moved away from using it but I guess you underestimate the intellectual capabilities of people using it.

How you want to write CSS is a tradeoff.

Traditional CSS without tools like Tailwind, styled-components or other "hacks" is especially bad at collaboration and evolving from prototypes to large sites or apps, in my experience.

They arent dismissing the users of tailwind's intellectual capacity.

They're attributing a cult like / social influence phenomenon to the popularity of it. That others use it because others use it; not on any perceived by them actual merit of tailwinds design.

I was basing my comment on the perceived assumption that this would be the only possible reason to use it.

I was convinced to try it by Adam Wathans initial blog post comparing it to BEM notation and "semantic" class names.

The arguments in that blog post still make sense, regardless if you think that tailwind is a good solution.

A cult like / social influence phenomenon is attributable to a lot of tech. Not sure if I'd call that "mass psychosis" though.

Sure, Tailwind tends towards lock-in, it also adds complexity in other places. It also will surely go out of fashion soon, or already has.

But it brought a concrete idea to the table, which worked for many people, and that was the reason for the "hype", in my opinion. Not "mass psychosis".

I never wanted to use it because of fashion. Maybe that was the reason I got to know about it though.

Also it influenced the way I write CSS, despite not using it anymore. In short: avoid being clever with the cascade, like the plague.

And I mainly stopped using it because I changed my job after 5 years. The projects we used tailwind for went well and it succeeded at avoiding the problems I wanted to avoid, especially when collaborating with a newly hired young colleague.

So yes, it is an example of a hype, might have been overhyped, but that's not "mass psychosis" to me.

I dislike tailwind too. Maybe I just use it wrong. But if I say have a number of similar-ish elements with many overlapping classes, when I need to make a change it affects numerous lines of code.

Traditional CSS? I’d update a style in a few specific spots and everything benefits.

You can still use your own custom classes with Tailwind.
And then you've come full circle though right?

I wish I liked tailwind it's all the rage but I just don't

You can still use normal css if you're styling multiple things. I think tailwind shines mostly when the css does not need to be reusable or is encapsulated in a component which is how it works in some modern web frameworks.

The reason why it is big is efficiency. Once people know those class names by heart, they get a "nice" (arguably) default style very quickly without jumping between multiple files. This matters more than one might think..

As a dev, I like Tailwind. As a consumer, it has stripped away a lot of how I learned to write websites in the first place. "View Source" is confusing now. Gone are the days of beautiful CSS selectors.

Tailwind sacrificed that for dev ux. The next generation will have a harder time learning about web primitives.

And htmx is not something I need for these days thankfully. I use phoenix liveview and get away with writing very little pretty dumb code. It's wonderful.

The whole "name it what its purpose is rather than what it does" like "alert-danger" rather than "giant-red-text" seems to have been thrown out with a lot of Tailwind. It prefers chaos but chaos is so much easier to adjust outliers. Those 2 divs have double the spacing between them? Just take the mx-5 off of one! It's hideous but so easy. Constant find/replace all.
You can add your `alert-danger` and whatever you need in `tailwind.config.js` or even directly in your root css file using CSS variables.
I've tried building design systems into Tailwind config a few times and found it to lose a lot of the potential value of tailwind.

Markup is no longer portable without bringing the config with it and devs still need to learn the custom styles and classes we defined, meaning Tailwind knowledge alone doesn't get you up to speed right away.

To your example, recent Bootstrap has a mix of component and utility classes that lets you do both "alert-danger mx-0" or whatever.

I also avoids the giant size of Tailwind classes that requires that elaborate build/reduction process. You can just include Bootstrap from a CDN or whatever.

There's also daisyUI, which is sort of like Tailwind + Bootstrap: component-based, but made with Tailwind. Cuts down on the tag soup pretty nicely.
Yes DaisyUI is nice. Ironically, it convinced us not to move from Bootstrap, because we realized its components were almost 1:1 with Bootstrap. And that we actually don't want the infinite styling options that Tailwind offers, so that devs mostly use design system components. At that point, who cares where/what the CSS is?
flex and gap-5 are king
Yes! A few of the many, many, many CSS definitions to get us where `<table>` got us in 1996. See ya later colspan, rowspan.
There are probably more webdev tutorials than there were websites back then. The next generation will be fine.
I hadn’t really thought about that! I guess LiveView kind of does the same because often I’ll look at the network requests of a page to understand/debug stuff and you can’t really do that with LiveView because you just get the HTML updates over the socket.
I'm leading a large project right now, and I'm shocked at how well tailwind is working such that everything is consistent. I even hired a personal intern to build "headwindcss" that converts existing websites into tailwindcss templates using the computed style.

A future project of mine is to build a mini-browser of sorts, and I'm going to use tailwind as the minimal basis for getting the CSS to work. so... I'm enjoying it... like a lot.

I'm actually working on a project called "Failwind". It uses AI to figure out what you were trying to do with Tailwind, then rewrites your CSS using semantic classes.
You are not. As a dev I understand the temptation of Tailwind, but I don’t see the benefits really worth it in all cases where I see it’s used. Writing plain CSS just makes so much more sense in the long run.
I have opposed Tailwind to no end. But I gave it a try and the portability it brings to markup is beyond description.

You just move HTML from anywhere and it would just look exactly the same (subject to your overrides/customisations of course) so I don't think Tailwind is going away anywhere.

Rather, it now can be thought of as a mini language or notation built on top of CSS.

I personally don't like Tailwind. But I do see a lot of benefits of using utility classes for basic layout stuff.

So far UnoCSS works very well for me. It's like light-weight and customizable Tailwind. Also for more complicated "components" I use css modules and refer to my theme values via directives (I think this is doable in Tailwind too?).

You aren't the only one... I liked bootstrap combined with a component library that abstracted it a bit much more.

I'm thinking something similar using a web component library could be good. Maybe material or fluent based.

You are obviously entitled to hold whatever view. I didn’t feel informed or enlightened by your comments.

I wish people move away from describing things they dislike as bad, horrible, dumpster fire. Describing the problem in a discussion site is always better

The pain or disgust is a strong hint that you're thinking about it wrong. If you have a bunch of repetitive CSS, how do you typically eliminate that? You create a class that bundles it all together and then just use the class name on the HTML.

But notice how you're then left with a bunch of repetitive HTML on which you apply those classes. If you bundle up the repetitive HTML into a reusable abstraction (like a component), then you're no longer repeating the CSS and so you don't need to bundle the CSS into classes anymore, thus reducing work. A type of inline styles, without the limitations, then gives you more direct control over styling on the bundled HTML itself. That's how you should use Atomic CSS/Tailwind.

That’s where web components comes in.
I used to love tailwind. Used it a ton. Not so much anymore. Plain CSS is enough for me.
It's great for influencers and beginners because of the ability to copy and paste examples plus the hype. The moment you put a scenario where there is no boilerplate available on the table, the utility of tailwind goes out the window.

As for Htmx, it's nothing new. I don't dislike it, but comparing it to web frameworks like React is missing the point. A lot of what it gives you (or doesn't) can already be achieved with a bit of vanilla js and, if you're feeling fancy, jQuery. Advocating for it as a replacement for something like React is sort of like recommending a bicycle to someone who drives. Yeah, it has its place, but it doesn't replace the utility of the car. Insisting it does indicate you don't know much about cars - or maybe bikes.

Anyway htmx uncomfortably reminds me of the MVC servers we use to write 15 years ago where the frontend always ended up being an unreadable unmaintainable mess after a few years because the frontend was treated as a random collection of assets for views to use.