Live data from Hacker News

Why Tailwind CSS Won

matt-rickard.com

201–210 of 559 posts

Re: Why Tailwind CSS Won

#201
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.…

You absolutely don't have to name everything in CSS. Naming components is sufficient. And you already need to do that. Using good HTML markup provides you with 80% of the styling hooks you need in a component. Specificity management and flexibility can be baked in too.

As for the media queries being hard/tiresome to write, don't we have IDE auto-completion for this exact purpose?

Re: Why Tailwind CSS Won

#202

Earlier quoted context omitted.

I’ve learned CSS, used Bootstrap, and tried a bunch of other tools. Tailwind ecosystem is the fast approach to building web UIs in my experience. It doesn’t matter if you know CSS or not. Nobody gains if you know CSS per se. People gain when you deliver finished projects. Tailwind helps ship projects faster.

As a user of web sites, this attitude leads to me paying for your fast shipping in electricity for CPU usage, extra money for extra RAM, plus wear and tear on my nerves because you do what your library allows you to do instead of something usable. Thank you.

Yes as we have seen through the years, pure CSS has resulted only in energy-efficient websites that are highly usable.

Slash

Ess

Re: Why Tailwind CSS Won

#203
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_,…

Totally agree. Sometimes I feel old when having the same opinion.

Re: Why Tailwind CSS Won

#204

Earlier quoted context omitted.

Having a prebuilt consistent design system that you don’t have to build out for each project, arguing over defaults among the team is a lifesaver.

But you don't need Tailwind for that. A "designsystem.css" file with custom properties would do the trick. Without any added third party tech.

Why should anyone care about adding third party tech?

This argument boils down to: “But you don’t need Tailwind for that. You can do more work for a (almost certainly) worse result with a designsystem.css!” Sure you can! Why?

Re: Why Tailwind CSS Won

#205
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 component... And for cases where you want to inherit styles, you can just use the regular light DOM.

All these frameworks are re-inventing the wheel and making it worse.

It's like having a perfectly good car and then attaching a horse at the front to pull it because you don't want to learn how the car works...

Re: Why Tailwind CSS Won

#206
post #170
post #162

Earlier quoted context omitted.

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.

Work in bigger teams with bespoke css. It will happen ... eventually ... without fail.

Re: Why Tailwind CSS Won

#207
post #156

Earlier quoted context omitted.

> You're not learning anything valuable by learning Tailwind. 1. You need to know CSS to use Tailwind 2. I learned and understood quite a few of things I rarely use thanks to Tailwind's amazing docs. Docs that are non-existent for CSS 3. I'm reasonably good with CSS, but I could never come up with a consistent and minimal design system that Tailwind offers That said, to things everyone should read to up their CSS gam…

If you know CSS why are you using Tailwind which is esoteric CSS but worse? Just use CSS.

Because it’s way, way faster to build with; yields more easily composable, less brittle components; and has a very solid (and rather unopinionated) design system baked in.

Re: Why Tailwind CSS Won

#208
post #133

As a primarily backend person, I like it that our frontend uses tailwind due to the copy-and-pastable aspect. I can nab an element from another part of the site and adapt, or take an element from https://tailwindui.com/ and know that it will paste in and look exactly as intended. It doesn't look good, or particularly inline with the style of the rest of the site but is good enough as placeholder UI before frontend/de…

What causes me to constantly shudder is when I have to use project wide search to find the class name on an element so I can see what was caused the computed styles in the browser to occur. 1. Find source file with class name. See the scss extension, dread rises a bit. 2. See scss file has multiple @import directives and uses multiple custom functions. 3. Open up 4 more scss files to see what those imports and functi…

But these are self-inflicted wounds. Having standards and validation for CSS is easy. No need for all of this. No need for SASS either. Install Stylelint and there you are.

Re: Why Tailwind CSS Won

#210

I never got how is "context switching" such a problem. I mean, can't you have like, two files opened side-by-side in different IDE panels? Is it really that hard to "look jump" from one another? This justifies the amount of overhead added by a library like this? If I can be blunt: I find this "argument" to be lazy as **. Sorry but "context switching" is just a fancy name for "having two files opened at the same time"…

You've never had to search through multiple stylesheets and Inspect to figure out inheritance and cascading for a CSS rule that is resisting editing? I recently had to work with another developer's codebase that had four different CSS files influencing the HTML, only to find in a fifth file an !important that was mucking everything up.

If you haven't experienced costly context switching working on FE then consider yourself fortunate.

Post reply on HN