Live data from Hacker News

Why Tailwind CSS Won

matt-rickard.com

161–170 of 559 posts

Re: Why Tailwind CSS Won

#161

I think Tailwind is more accessible to many[*] less experienced or CSS-oriented developers. Big generalisation , I know, please don't yell at me, but many of us can get 99% of Tailwind's value with UI libraries supporting: 1) style encapsulation, 2) colocated presentation/content/behaviour and 3) a more minimalist mindset/habits when building UIs (e.g. relying on simpler styling hierarchies, native DOM elements, sema…

>I think Tailwind is more accessible to many[*] less experienced or CSS-oriented developers. Umm... How? You have to know CSS and be quite proficient to understand how to map it to Tailwind. I don't understand this claim at all.

This is called a leaky abstraction.

I believe I'm convinced that if an abstraction is leaky then it's garbage.

For instance, if I really needed to know say, jvm assembler to code Java then Java would be garbage as an abstraction layer because it would simply be creating problems where they need not be.

Java however is clean, which makes it useful. I don't need to know the next level down. C is clean. JavaScript is. PHP is.

Tailwind is not. Many frameworks are not. They promise benefits but deliver complexity and programmers get invested into the system and then can't see the reality because it's a classic cult effect of giving emotional salience to a lie.

Eventually it collapses and a new one is formed.

And for some unknown reason, this. Shit. Does. Not. Stop.

It's really exhausting. Been programming nearly 30 years. So sick of it.

It would be like if I did say medicine and every 3 months or so the medical community started tripping over itself by believing in the latest weird quack with orgone energies and magnets and started writing prescriptions to their patients about chakras or astrology and then being shocked, like actually genuinely surprised when it all collapses.

Why do people run around like a bunch of frenetic teenagers to manufactured hype cycles in programming? Can we please fucking stop. Honestly.

Re: Why Tailwind CSS Won

#162
post #113

Earlier quoted context omitted.

I assume OP means that for the fist button of the site, as in creating the site from 0.

In that case, you just write button { /* your styles here */ } to set a precedent for all your future buttons.

In that case you end up with fifteen different variations of that button, class names like "button-cta__hero__overlay" and a smattering of !importants to defeat the cascade you can't chase down

Re: Why Tailwind CSS Won

#163

I love tailwind, and I've been writing CSS professionally since CSS2.1. I have often debated with many developer friends why it has performed so well, and this article really missed some big reasons: 1. It's works extremely well with the current component-focused UI frameworks (react, svelte, etc). Subsequently, the verboseness that is often a complaint isn't an issue at all, but a feature. 2. Does everything out of…

1. For component usage and in this case only restricted. You can only style the top layer of a component, not each part. But for component development, tailwind made it complex, e.g. if you want to make it possible to set / add custom styles to each sub-element.

2. Vanilla CSS too.

3. For designers with individual styling of components Tailwind is great, but not for app where elements have the same style or developed at component level.

Re: Why Tailwind CSS Won

#164
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 agree but

ultimately what is cheap and fast wins. the future is someone else's problem.

i think that's a good description for javascript too.

Re: Why Tailwind CSS Won

#165

Earlier quoted context omitted.

Except for the whole "Cascading" part. I think I understand tailwind, but like the parent poster I'm really not a fan, because while CSS can be a footgun, it can also be quite clean when you use a sane DOM structure, CSS variables, and well thought out CSS selectors.

i think that’s what people’s argument FOR tailwind is: CSS can easily be a footgun, unless everyone on the team uses a sane DOM structure, CSS variables and well thought out CSS selectors. i’ve yet to witness a project without “!important” scattered throughout the codebase.

That's sad to hear. Good CSS with an intuitive DOM structure is simple to achieve yet so powerful. Hate to see devs give up that power.

Re: Why Tailwind CSS Won

#166

I find Tailwind's claim that you can "build modern websites without ever leaving your HTML" to not be entirely correct. Instead of context switching from my `.html` to a `.scss` file, I just end up context switching to their documentation website to find the syntax they used. It's internally inconsistent, so you can't guess what the Tailwind class name is for styling, while you can do this for CSS on the majority of…

a lot of this minutiae will be handled by gpt moving forward, and keeping it all in the same file will be helpful for context

Re: Why Tailwind CSS Won

#167
NGL tailwind is really nice to build new things and is absolutely amazing to create MVPs and small projects ...

but once you got to the point where you open a file and see 20+ classnames stacked in every div, which makes them unreadable, its just a mess. Love-hate relationships with this tool, but the idea is very good and this article mentions biggest selling points - its easy and very fast to use.

Re: Why Tailwind CSS Won

#168
post #45

If css had a strong opinion and better syntax for responsiveness by screen width, css frameworks were way less popular. Tailwind, bootstrap and co. aren't used to avoid writing css. It's used because writing `class="my-4 mb-sm-5 mb-lg-6"` is so much faster and easier then doing this with a bunch of media queries and a class name, that has to be unique, because css is a global scope nightmare. I mean, just look at it.…

Or, much shorter:

  .foo {
    padding: 1rem 0;
    @media (min-width: 500px) { padding-bottom: 1.5rem; }
    @media (min-width: 800px) { padding-bottom: 2rem; }
  }

Re: Why Tailwind CSS Won

#169
post #24
post #11

I don't get Tailwind. In my book, CSS is here to facilitate the style of multiple webpages by modifying a set of rules, and classes are here to mutualise said rules. With Tailwind, it looks like you design by writing HTML, which is the opposite of what CSS aims at. So if you wish to change your design, you'll have to update multiple templates instead of one CSS rule. Every time I've had to work with Tailwind, it felt…

I can sum up what I like about Tailwind in the following code: ``` (in CSS) a.link { border: red; } a.link:hover { border: blue; } ``` ``` (in Tailwind) ``` It's much easier in Tailwind for me to see locally what's going on with that styling. If I lived in this code all the time, or I was good at structuring CSS, then maybe the first would be more appealing. But I'm a shit at CSS, it always turns into an unmaintainab…

And when you create an App with hundreds of buttons?

And when the designer change his mind and border-red should not be used anymore?

And what if you have small changes, e.g.

```

Button 1

Button 2

```

Re: Why Tailwind CSS Won

#170
post #162
post #113

Earlier quoted context omitted.

In that case, you just write button { /* your styles here */ } to set a precedent for all your future buttons.

In that case you end up with fifteen different variations of that button, class names like "button-cta__hero__overlay" and a smattering of !importants to defeat the cascade you can't chase down

I've never ended up with something like this.
Post reply on HN