Live data from Hacker News

Why Tailwind CSS Won

matt-rickard.com

371–380 of 559 posts

Re: Why Tailwind CSS Won

#371
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 wished you provided arguments instead of "trust me bro".

Re: Why Tailwind CSS Won

#372

Earlier quoted context omitted.

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

If you don't know how the lower level layers under your current abstraction work, you end up on accidentally quadratic. Am I more clear now?

Do you know how Tailwind works? What you say is generally true, but I don't really see how it applies to TW...

Re: Why Tailwind CSS Won

#373

Earlier quoted context omitted.

> And for those that prefer a different editor? A plugin is likely available for that, too. I use PHPStorm a lot; https://www.jetbrains.com/help/phpstorm/tailwind-css.html Panic's Nova? https://extensions.panic.com/extensions/jasonplatts/jasonpla... Vim? https://vimawesome.com/plugin/coc-tailwindcss etc.

Missed the underlying point but I'll make it explicit - if a plugin is "needed" that is also a red flag for me.

I suspect the number of developers with zero plugins in their IDE of choice is vanishingly small.

That said, it's not needed. It's just a quality-of-life improvement, like most other IDE features. You can write a Tailwind site in Notepad, if you prefer.

Re: Why Tailwind CSS Won

#374
post #334

Earlier quoted context omitted.

> 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 { col…

I mean, the top just happens because color has 'inherit' by default. The latter is specificity, and normally what I think of when I hear "cascading". But, it turns out that isn't cascading either [0].

Cascading refers to the order stylesheets have priority when loaded by the browser. Going to have to update my definitions for the future. I always thought cascading referred to how specificity worked.

Edit: no wait, specificity is part of cascading, cascading refers to the entire process of determining which style applies, including specificity. Inheritance on the other hand is not part of cascading. My definitions were right, don't need to relearn anything.

[0] https://developer.mozilla.org/en-US/docs/Web/CSS/Cascade

Re: Why Tailwind CSS Won

#375

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…

> So as the bubble grows, you start also seeing jobs requiring "10 years of Tailwind experience" more and more often, the projects you rely on are starting to switch to Tailwind, and now you have to use Tailwind, like it or not, because everything is glued to Tailwind. If the bubble keeps growing, then we also see a myriad of "like Tailwind but for JavaScript", "like Tailwind, but for SQL", "like Tailwind, but for we…

Kinda.

If React dies I'll be sad. While most of React is BS, the "ReactDOM" component, the Virtual DOM model that is applied to the real DOM by "delta" diff, is a solid concept that deserved to live. Unfortunately we do tend to throw out the baby with the bathwater, when we decide something is uncool.

We're a very stupid species.

Re: Why Tailwind CSS Won

#376

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"…

It's worse than that. Tailwind imposes a ton of context switching by putting the style inline with you data. It's just that this switching happens when working on the data, instead of on the style.

Re: Why Tailwind CSS Won

#377
post #169
post #24

Earlier quoted context omitted.

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 ```

My solutions to the problems you raise, in order of preference:

1. Not worry about it, it probably won't happen on the projects I'm working on. YAGNI.

2. OK, it's happened. Get some coffee, make all the changes. Can I use a regex? Make the changes incrementally? Delegate it to a junior?

3. This is going to change a lot. Let's make a re-usable component, a named colour like 'primary' (in Tailwind config), or re-usable class like .button-default. The right solution will depend on the requirement.

In styling, I'd rather have 1000 obvious changes than 1 difficult one. The risk of having the wrong shade of red is not high enough for me to worry about abstracting it.

I appreciate that good, full-time CSS devs have much better solutions for this, but those solutions involve being good at CSS as a starting point. I don't have that luxury.

Re: Why Tailwind CSS Won

#378

Earlier quoted context omitted.

> why would it be? Because most frontend engineers cannot make something as visually appealing as Tailwind’s defaults and most designers cannot make frontend abstractions as ergonomic as Tailwind’s. Now it seems like you’re suggesting just reimplementing Tailwind? Or yes you can have one of your FE engineers and one designer try to dream up your own Tailwind but again: why? Now you’re consuming two people for somethi…

If the Tailind defaults are used in a design language file, wouldn't it be simpler? If it's only a problem of "aesthetics", 20 minutes is enough to use Tailwind's defaults in pure CSS. No need for calling a designer here either. Side benefits include that there is then no need to update any dependencies or library, no need to run a JIT server, no need for a new syntax, no need to wait for implementation of new CSS fe…

> 20 minutes is enough to use Tailwind's defaults in pure CSS

not 20 minutes, more. Plus all the boilerplate around @media rules

> no need to wait for implementation of new CSS features

What CSS features are you waiting for with Tailwind?

> better performance possibilities

It's very hard to beat Tailwind's performance since it's a fixed set of css classes (and a very small set in production, since it only includes classes you actually use".

Re: Why Tailwind CSS Won

#379

Earlier quoted context omitted.

This has been my general opinion on Tailwinds all along. When it first came out I thought it was kinda harmless, it's basically like some of the utility classes that always inevitably get made/used and that's great. But this idea that all styling should be done in HTML is antithetical to the whole reason CSS came to be in the first place, IMO. I can see why people like it to an extent, but I just don't really get the…

Styles get stupid when they're not local, it just creates a huge hassle as projects scale. The only answer is a css file per component, or css embedded within the component directly. This css has to have a preprocessor or you won't be able to maintain a functional design system or any stylistic consistency. So you're stuck with sass/less/tailwind regardless. Style classes are IMO the neatest way to inject styles, hav…

@layer has made all this much easier using raw CSS. One creates sensible global defaults in a `@default {...}` layer, and then they overwrite in a `@custom {...}` layer.

Re: Why Tailwind CSS Won

#380
post #189
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.…

And you write this crap `class="my-4 mb-sm-5 mb-lg-6"`hundreds of times in complex applications or `class="foo"`?

Do you practice atomic design? It shouldn't be an issue for you if you do
Post reply on HN