Live data from Hacker News

Why Tailwind CSS Won

matt-rickard.com

131–140 of 559 posts

Re: Why Tailwind CSS Won

#131
post #80
post #77

Earlier quoted context omitted.

If you work with components, you don't have this problem. If you don't work with components, good ol' search and replace and it's done.

If you work with components then why not just use CSS?

You can utilize the Functional CSS approach to eliminate the redundancy of architecture and behavior across various instances (JSX and CSS). Furthermore, it offers superior performance when compared to OOCSS.

Re: Why Tailwind CSS Won

#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/design can come in and tidy it up.

I do constantly shudder though when reading a list of class names like this:

> fixed inset-y-0 right-0 z-50 w-full overflow-y-auto bg-white px-6 py-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10

https://tailwindui.com/components/marketing/sections/heroes

Re: Why Tailwind CSS Won

#134
post #50

Earlier quoted context omitted.

> class="my-4 mb-sm-5 mb-lg-6" I've seen Perl code that was more readable than this.

If you know the convention it's quite easy. I don't know Tailwind but with Bootstrap it would be m = margin, y = y axis, b = bottom, sm/lg = screen size, 4/5/6 = size

4/5/6 what? Bananas? And what exactly is “screen size”? Does it refer to physical size, or number of pixels? Does it count width, height, or both?

Re: Why Tailwind CSS Won

#135

Earlier quoted context omitted.

Tailwind is also great for this. You create components with Tailwind that make this trivial

"trivial"? So I still have to componentize my presentation layers to do tailwind "correctly", but instead of writing CSS in readable multiline chunks in a language every developer already knows, I need to use this cryptic one liner in any order that literally nobody can read? What in the hell is wrong with this industry? Sometimes clever ideas aren't all that clever. Sometimes they're just dumb.

This might surprise you but most industry web development today is using components powered by a framework, and Tailwind fits in perfectly to the close coupling of styles to components.

Re: Why Tailwind CSS Won

#136

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

Re: Why Tailwind CSS Won

#138

I'm using Bootstrap in a Tailwind kind of way, with many utility classes. I don't use it's container system. How do you get a basic Tailwind design running? It seems like you need a Bootstrap equivalent on it anyway.

There is a persistent misconception that Tailwind competes with Bootstrap, but they just exist at different levels. Bootstrap provides components, but Tailwind is just a faster way to write CSS.

Components are just one part of Bootstrap nowadays, it also has helpers/utilities, the (css) grid system and flex, themes (light/dark) support w/ css vars.

Probably not granular enough for Tailwind fans though.

Re: Why Tailwind CSS Won

#139
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 the box, and very easy to customize.

3. And, most importantly, it allows for easy art direction. Does one button need to be a slightly different size or color for this one specific element? Chuck an extra modular class on it. No need to build a complex cascasding or edge cases. (Shout out to `tailwind-merge`)

Point 3 for me speeds up production work immensely. Also, not being in JS has shrunk bundle sizes by a small amount, which is always welcome in this era.

Re: Why Tailwind CSS Won

#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_, and excruciating to clean up.

Go ahead, downvote me to hell, I'll see you in 5 years.

Post reply on HN