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…
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.
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.
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 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.
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 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.
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.
niceice|2 years ago
It's like the coding version of https://en.wikipedia.org/wiki/Dancing_mania
rpmisms|2 years ago
mhh__|2 years ago
unclebucknasty|2 years ago
Then, I encountered the raving fans. That's when I knew the shark had been jumped.
moritzwarhier|2 years ago
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.
hipadev23|2 years ago
Traditional CSS? I’d update a style in a few specific spots and everything benefits.
artificialLimbs|2 years ago
sureglymop|2 years ago
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..
sergiotapia|2 years ago
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.
andirk|2 years ago
LudwigNagasena|2 years ago
mcintyre1994|2 years ago
mathgladiator|2 years ago
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.
unclebucknasty|2 years ago
SnoozingBoa|2 years ago
wg0|2 years ago
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.
tuzemec|2 years ago
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?).
tracker1|2 years ago
I'm thinking something similar using a web component library could be good. Maybe material or fluent based.
zaphirplane|2 years ago
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
naasking|2 years ago
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.
iamgopal|2 years ago
acheong08|2 years ago
RobertWHurst|2 years ago
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.