Live data from Hacker News

Why Tailwind CSS Won

matt-rickard.com

341–350 of 559 posts

Re: Why Tailwind CSS Won

#341

I always felt slightly dirty after writing a bit of inline CSS (`style=”color: red“`) instead of a proper class, yet at the same time it accomplishes the goal and it was fast. So this is basically Tailwind, right?

Basically, but with two important extras: media queries and child selectors. It’s impossible to write a media query or target a child with inline styles. With tailwind, the first one is encouraged and the second is at least possible, and in some scenarios, encouraged (group hover).

Child selectors I can understand. But won't media queries mostly be limited to containers and thus used sparsely and those cases would warrant having a class of their own even if one decides that named classes for each element is a hassle?

Re: Why Tailwind CSS Won

#342

Btw Tailwind isn’t a religion…if you don’t want to use it, that’s fine. It has helped a lot of people - myself included - write more and better CSS but I don’t understand the vitriol here. If you want to write vanilla CSS or BEM or Sass or Less, I think that’s great.

Most folks would agree with you that we can use what we like but that isn't the reason for the vitriol. I think most of the vitriol comes from the way the it is presented as "the winner" when a lot of people either actively dislike it or would never chose to use it.

I dislike Tailwind and would never choose it so seeing it presented as if it climbed to the top of some pile makes me laugh out loud and based on the comments there are a fair few people that agree. That said, use what works for you and I won't try to claim my choices as "winners" in some undeclared contest.

Re: Why Tailwind CSS Won

#343

Earlier quoted context omitted.

It is good because Tailwind actively fights the engineering choices behind the web platform, it doesn't understand them, it doesn't build on top of them in synergy and alignment, but it counteracts and nullifies them with religious fervor and zeal. Tailwind projects read like the wall writings of a mad man, who is convinced they've discovered the secret of the Universe. And that secret is compiling absurdly large, GI…

I'm not sure I fully agree with your view on what tailwind is and why it is growing. In my opinion, tailwind is gaining some popularity because some people find it faster and easier to use than writing traditional CSS files. I realise it also has some downsides, and seeing all those class names in the html is particularly ugly, but if the people using it got their project out faster, then surely there is a place for…

Technology choices, and life's choices in general are like a spectrogram of different wavelengths with positive and negative values... Like "this will help you today, but bite you in the rear tomorrow", or "this will help you tomorrow, but be annoying today". And it also varies by different conditional developments, if this happens, if that happens, can you implement a change, or the solution is "write-only" and so on.

One of the tests of intelligence is can you defer immediate gratification, so you can reap higher rewards in time that compound themselves, or you lack impulse control and therefore you essentially have the model behavior of a house fly.

This incessant focus on "here, now, me" that I see glorified, which doesn't consider at all anything outside a point in time and space that demands the impulse to be immediately satisfied... is not a good direction for tech, or for society at all. It's like choosing porn over a family.

Obviously, I'm describing a broader problem here, not just some CSS tool, but Tailwind and many of the "frameworks" we see pushed in the industry do also embody this philosophy, quite clearly. Many things do these days. Ship faster, do less, faster, faster, faster. To what end? Are your projects so worthless, that you need to ship them today and then leave hell to yourself and others few months down the line? Not to mention that all the claims Tailwind is "faster", somehow, are written in weasel language to hide the fact Tailwind adds tangible, often significant lag and load to people's devices when they use your site. Does this matter?

Of course, a fancy experiment is all good. You won't see me writing long posts about how Brainfuck is the end of humanity. But Tailwind has a good size community that actually believes their approach is superior, they're on a mission from God, and it's become viral, dragging in more and more people in, and influencing other projects into the same stupidity. What else does it mean to write a post called "Why Tailwind won". Won what? Was there a war going on? Won over what? Bootstrap? Bootstrap is a framework. Won over CSS? It runs on CSS, it's not an "alternative to" CSS, although it sure makes it impossible to use most of the benefits of CSS in a sane way. Yay, what a win.

If Brainfuck was totally serious, and you saw your company is starting to write critical projects in Brainfuck, wouldn't that give you a serious pause?

Re: Why Tailwind CSS Won

#344
post #140

Gray beard's 5c: Tailwind is a farce and a catastrophe. It's as modern as the style parameter is, and it's as reusable as a moving a dirt pile from one corner to the next. You're not learning anything valuable by learning Tailwind. Learn CSS, that will stick with you for the next 20 years. It amuses me when a library is implemented 'with tailwind', which means it's totally useless to the people _not using tailwind_,…

Agree 100%. CSS is so good nowadays. Tailwind is yet another over-engineered hack of a framework foisted upon us. A solution looking for a problem. You don't need it. Do devs these days even know about Web Components and shadow DOM? You can define per-component styles now with CSS selectors to target any child elements within the component and you can do it in such a way that the styles are contained within the compo…

You're trying to sell me Web Components as a solution to over-engineered hacks?

Re: Why Tailwind CSS Won

#345
In terms of skillset, I’m mostly a backend guy (of 20 years or so). I know my way around HTML and CSS, and I have a decent eye for design, but it’s not my primary focus.

I recently started a writing project, and found myself unhappy with choosing a standard blog theme, and decided to build my own.

For this purpose, Tailwind has been incredible. I don’t have plans to become a front end dev, and investing significant time in improving my CSS skills is not a good use of time for what will be a fairly small project. It gives me more flexibility than frameworks like Bootstrap while still offering a lot of the productivity benefits. It lets me explore concepts and ideas that I otherwise wouldn’t have the skills to play around with.

This thread reads like most $language/$framework/$os holy wars. There is an awful lot of hatred over a perceived lack of “purity”, or because of the perceived superiority of other approaches. Like most of these technology debates, the extreme binary positions really miss the value that can be found in the middle. Tailwind has been great for getting ideas out of my head to see how they look, and for staying focused on the content that I’m planning to write instead of getting stuck learning about browser edge cases.

If I start focusing more of my time on building UIs, I’ll invest more deeply in CSS.

I’m also fairly convinced that many of the negative comments filled with disgust at the resulting syntax have never tried it. After about 10 minutes, the conventions start to become obvious, and I can write visual elements mostly at the speed of thought. This is really quite enjoyable.

I’m also not suggesting it’s the right tool for every job. But the lack of nuance in much of the discussion here is pretty disappointing for the HN community.

I personally feel that the future of the (useful) web depends on more people choosing to do their own thing. Tools that lower the barrier to entry and simplify content creation will always be important.

Re: Why Tailwind CSS Won

#346

Earlier quoted context omitted.

But in components with scoped styling, you're better off just using css directly. Create a class that has all the styles you want, then use it in the HTML - nicely and cleanly separates css and HTML code.

Why do you want to separate the CSS and HTML? They’re both style info, especially in component design.

Because they're not both style info? Html is a markup language, it applies semantic structure to your content, CSS styles html.

Classes are a tool for selecting markup to style. Sure, you can create a class for every single CSS rule you write, but just because you can doesn't mean you should.

Re: Why Tailwind CSS Won

#347
People on HN (and elsewhere) said bootstrap was terrible when it was the most talked about CSS framework. Now it's tailwind.

The top comments will always be negative.

Don't give too much weight to this when choosing what tech to use.

Re: Why Tailwind CSS Won

#348
post #140

Gray beard's 5c: Tailwind is a farce and a catastrophe. It's as modern as the style parameter is, and it's as reusable as a moving a dirt pile from one corner to the next. You're not learning anything valuable by learning Tailwind. Learn CSS, that will stick with you for the next 20 years. It amuses me when a library is implemented 'with tailwind', which means it's totally useless to the people _not using tailwind_,…

Five years? How about now. I saw a video a few months back featuring a VScode plugin to hide tailwind styles. If you have to use a plugin to manage your nuclear waste code by hiding most of it something is wrong.

Tailwind advocates don’t maintain their code, they just hop between companies and leave the disaster behind for someone else to deal with.

Re: Why Tailwind CSS Won

#349
post #334

Earlier quoted context omitted.

This is not true. There's no way to create a "non-cascading style rule" unless the style rule already doesn't cascade. You still have to understand the cascade in order to use Tailwind.

> You still have to understand the cascade in order to use Tailwind. Can you expand? I haven't used Tailwind, but from looking at the docs, it looks like a short-hand syntax for writing inline styles. Not exactly the same since it can take advantage of media queries and other things that you can't do with inline styles, but close enough conceptually. Where is the cascade with Tailwind? Perhaps I completely misunderst…

There are two different things people could be referring to when they mention the "cascade".

One is CSS style inheritance. So if I do this:

  
    hello
    world
  
The `text-blue-500` style is going to cascade down to the descendent elements. That's just how CSS works and there's no getting around it.

The other usage of the term applies to a style of writing CSS that makes use of this cascade. So something like this:

  .card {
    color: darkgray;
  }

  .card .header {
    font-size: 20px;
  }
I think what people are referring to in this thread is the latter, which is not the cascade, but a particular approach to CSS.

Re: Why Tailwind CSS Won

#350
post #140

Gray beard's 5c: Tailwind is a farce and a catastrophe. It's as modern as the style parameter is, and it's as reusable as a moving a dirt pile from one corner to the next. You're not learning anything valuable by learning Tailwind. Learn CSS, that will stick with you for the next 20 years. It amuses me when a library is implemented 'with tailwind', which means it's totally useless to the people _not using tailwind_,…

I would concur that all I mostly need is CSS modules and to know when styles should be copied (most of the time) or actual utilities (rare).

Any remaining reusability can be handled with templates / components (depends on your framework).

The remaining potentially nice thing about Tailwind is that it more naturally constrains your options/syntax with utilities - when working with designers, this is probably a good thing. As always, the hardest problem of development is finding technology that best establishes the social contract.

Post reply on HN