Live data from Hacker News

Why Tailwind CSS Won

matt-rickard.com

471–480 of 559 posts

Re: Why Tailwind CSS Won

#471
post #455

Earlier quoted context omitted.

First, the site uses some weasel language to speak about how much they're "focused on performance" in such a way as you think Tailwind is literally faster than doing normal CSS. It's not. It's a heavy approach and while you can always find edge cases to the contrary, in general it leads to pages that add lag and load to people's devices. If you have a very simple page this doesn't matter, but as your site/business gr…

I would donate more upvotes to this multi-part tirade if I could. I haven't used Tailwind, or any other CSS framework, because I have never understood why I would want to, having attended a talk about a similar system back in the day where styles were turned into weirdly specific CSS classes, as if they were trying to reinvent font tags. The way you've described it is pretty much what I would expect from such a thing…

I suppose it depends if you're trying to build the perfect website, or just want to get something launched fast.

I usually build websites to solve a problem, or to try out a business idea. The structure of the HTML and whether I am using a web framework are not important to me.

The main thing is, can I get this finished and looking great in a few days.

Re: Why Tailwind CSS Won

#472

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…

To enjoy tailwind you have to install the vscode plugin so it will speed things up when searching for the right class. Also watch some short tutorial to get an overview. If you don't appreciate it after this then it really isn't for you

Haha - I enjoy tailwind and have no idea what plugin your talking about. What is the name?

Re: Why Tailwind CSS Won

#473

Earlier quoted context omitted.

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

When has anything in tech ever actually died? I guess there will be people building sites in React forever. Haha

Re: Why Tailwind CSS Won

#474

Earlier quoted context omitted.

To enjoy tailwind you have to install the vscode plugin so it will speed things up when searching for the right class. Also watch some short tutorial to get an overview. If you don't appreciate it after this then it really isn't for you

Haha - I enjoy tailwind and have no idea what plugin your talking about. What is the name?

Tailwind intellisense by tailwind labs

Re: Why Tailwind CSS Won

#475
post #455

Earlier quoted context omitted.

I would donate more upvotes to this multi-part tirade if I could. I haven't used Tailwind, or any other CSS framework, because I have never understood why I would want to, having attended a talk about a similar system back in the day where styles were turned into weirdly specific CSS classes, as if they were trying to reinvent font tags. The way you've described it is pretty much what I would expect from such a thing…

I suppose it depends if you're trying to build the perfect website, or just want to get something launched fast. I usually build websites to solve a problem, or to try out a business idea. The structure of the HTML and whether I am using a web framework are not important to me. The main thing is, can I get this finished and looking great in a few days.

I hear this argument a lot, on the surface it makes sense. We all want to ship fast. Right?

But then... I try to imagine how Tailwind allows you to style your site in a few days, but it'd take you, the same person, what... weeks, to style it with CSS? It's so ridiculous it's making me laugh out loud just imagining this somehow. As if CSS is this thing for rocket engineers that is way beyond a common man's grasp?

Seriously, how LOW is the bar, I don't get it? When is something as easy and basic as CSS... just easy enough? "property: value;" Or have you never given CSS a chance, and you were heavily gaslit by Tailwind marketing into thinking CSS is a scary monster and here comes the savior Tailwind? I can accept the latter, but this is also the reason why I find these fad frameworks such a harmful phenomenon. But I can't fathom the former.

Re: Why Tailwind CSS Won

#476

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…

How do you style with pseudo selectors (e.g. :hover)?

https://tailwindcss.com/docs/hover-focus-and-other-states

Re: Why Tailwind CSS Won

#477
post #455

Earlier quoted context omitted.

I would donate more upvotes to this multi-part tirade if I could. I haven't used Tailwind, or any other CSS framework, because I have never understood why I would want to, having attended a talk about a similar system back in the day where styles were turned into weirdly specific CSS classes, as if they were trying to reinvent font tags. The way you've described it is pretty much what I would expect from such a thing…

Hahaha - I wonder if Tailwind is starting to take over from frameworks v no-framework as the best way to start a huge fiery debate on HN!

Tailwind is extremely polarizing, yes like frameworks, and yes like politics. This polarization tends to happen on the two sides of "reality distortion fields", where someone's propaganda on one side, doesn't match propaganda on the other side. It's like Russians believing the West is the worst, and Putin is there to save them from The Gays. Or the West casually ignoring their impact on Russia with NATO advancing to the doorstep of an old, imperialistic, paranoid regime. What are they supposed to think?

But describing this as merely "both sides have equal merit" is really crude. Because more often than not, one side tends to be closer to the truth. Maybe Tailwind has some neat ideas. In fact I'm sure it has some neat ideas. Placed carefully somewhere in the calm eye, the dead center of this tornado of bullshit that is Tailwind overall. But then again, we can't ignore the tornado of bullshit.

Re: Why Tailwind CSS Won

#478
post #443

Earlier quoted context omitted.

++ for mentioning web components and the shadow DOM. They are the end of the road for prepackaged frameworks, IMHO.

Web components are a decade old, what do you think has changed or will change to make them more popular than frameworks? I think unless there are massive improvements to the developer experience the best hope for web components is as an implementation detail for a higher-level framework.

Good question. I probably should have qualified my statement. I can think of a lot of cases where an organization is better off building custom components on something like Lit (close to bare metal), rather than trying to shoehorn Angular or React into what you want. On the other hand, having a lot of predefined pieces and methods is also helpful to some people.

For me, I've been bitten and I would pick web components over a fixed framework for a clean sheet project. I don't think many devs have really tried to work with web components or they might get the bug, too!

PS: I wrote an intro series on this topic on Medium[0].

[0] https://medium.com/gitconnected/getting-started-with-web-com...

Re: Why Tailwind CSS Won

#479

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…

I actually agree with most of your comment. Just not that Tailwinds is the best way to actually do the styling. I don't have any issue having some form of compilation/processor step that takes colocated CSS and creates a final output, that isn't my objection to Tailwinds, in case that wasn't clear in my original comment. I prefer to actually use CSS, most often via style classes.

And I did not say to base styles on html structure - you are correct, that is brittle and actually one of the things I often ask about in FE interviews as a way of determining skill level. I said that good html structure makes CSS much easier, if your structure is bad, it can significantly compound the amount of CSS needed in order to achieve the desired outcome. So I believe there is a significant distinction in those two statements.

Re: Why Tailwind CSS Won

#480
post #326

Earlier quoted context omitted.

the cascade has as many benefits as it has drawbacks, few people like to juggle specificities. IMHO the only important application of the cascade is in its original purpose: custom user defined stylesheets (today often via browser extension or adblockers), but you can add proper descriptive attributes to your markup for them.

In today's uses, cascade _with_ custom properties (the vars defined within :root ) are powerful and are what I leverage when providing theme-able ui libraries. Dark mode, light mode, large mode can all be solved using custom properties which to me most exemplify the power of the cascade.

that is inheritance not the cascade: Inheritance allows for DOM nodes to use properties set on their ancestors, the cascade algorithm is how multiple conflicting rules interact and are overwritten.

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

https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_...

Custom properties are by default inherited by all descendant nodes (they also interact with the cascade, but it is less relevant) and this can be used with tailwind in a couple of different ways: https://stackoverflow.com/questions/64872861/how-to-use-css-...

Post reply on HN