Live data from Hacker News

Why Tailwind CSS Won

matt-rickard.com

351–360 of 559 posts

Re: Why Tailwind CSS Won

#351

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

And for those that prefer a different editor? Just saying, if a tool then pushes you into another specific tool for maximum efficiency using it, that alone gives me pause.

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

Re: Why Tailwind CSS Won

#352
post #249

Earlier quoted context omitted.

My experience mirrors yours 100%. What the parent comments seem to be describing are Tailwind in a context where people don’t know CSS that well. Yes, that will be a catastrophe. But so will SASS or vanilla CSS — even more so. Tailwind is a utility, not a replacement for fundamental knowledge.

On the other hand, people that know CSS very well will not need suddenly tailwind to get some utility classes.

I've been writing CSS since 2009 and I love Tailwind. It allows me to very quickly build UI that has a consistent look and feel without having to stop and think.

Re: Why Tailwind CSS Won

#353

Earlier quoted context omitted.

I'm not sure you understood correctly what I meant. Or maybe is it me. Hehe. To reiterate: you can link and load CSS for a component just when this component is used instead of loading everything at first. So the first load of the page is faster. Same thing with media queries in link tags. Isn't that something Tailwind can't do? Tailwind will load every style, every time, right? As for your example, I get your pain.…

I think we largely agree, so I'll go back to focusing on the tool. > Isn't that something Tailwind can't do? Tailwind will load every style, every time, right? Tailwind's only function is: - Scan codebase - Generate classes - Save them in a file with the a .css extension. Anything else that you want is outside the scope of the tool. It makes no assumptions about what your files are named, where they are, or how it's…

But can you split the Tailwind styles in multiple files so that only what is now displayed in the browser is loaded?

That's the part I'm not sure of.

Re: Why Tailwind CSS Won

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

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…

I stayed away from Tailwind for the exact reasons you described until i joined a company that used it heavily and now I really see the value of it. I’m weary of new tools and cargo cult but Tailwind won me over.

It really shines for apps that are changing rapidly and are at risk for generating dead CSS, which has been a problem in pretty much every commercial codebase I’ve ever worked on. Tailwind adds a simple, straightforward, one-way-to-do-things approach that creates a much more maintainable experience in HTML templates that results in zero dead CSS code.

It’s absolutely not for people that need fine-tuned CSS APIs like animations, etc. But for building a product rapidly, it’s become a go-to for me.

Re: Why Tailwind CSS Won

#355

Earlier quoted context omitted.

Cool hot-take but it’s not true. You’re literally learning CSS when you learn tailwind. And no one (good) picks up a tool solely because it’s shiny, they pick it up because they find it has utility, which evidently LOTS of people do. And if you don’t think it’s reusable then you at least need to bring an argument for why that’s so because the docs, personal anecdote, and the opinion of LOTS of people is completely op…

> And no one (good) picks up a tool solely because it’s shiny The amount of cargo culting going on right now is at an all time high. People do stuff all the time that makes no goddamned sense and is defended by, “well Google is doing it!” You are not Google and you never will be.

>The amount of cargo culting going on right now is at an all time high.

In fairness, CSS is such a mishmash of things that it lends itself to cargo-culting.

You can fit the number of people who are exclusively CSS experts in a van and still have room for their luggage. Everybody else is going "that's cool, how do I do that?" and then copy/pasting it.

I mean, hell, it was years before you could reliably vertically center stuff with CSS (that we were doing with table-based layouts since the 90s). And considering the number of wonky layouts I've seen in what should be professionally done mobile Web sites, it's clear that it's hardly a Done Thing.

The nerd in me really likes SCSS, because I can more or less wrap my mind around it, but I get the Tailwind way as well. As a developer, CSS is way down my list of things to know intimately. Whatever I have to do to keep things moving, I'm good with it.

Re: Why Tailwind CSS Won

#356
post #310
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_,…

Tailwind is made for a component world where reusability is at the template/component level. This also covers both scoping issue with css: the usual issues with the single global namespace for classes and the unlimited depth of the descendant selector. That is even with scoped classes if your app has component nesting as then a selector like .A_box::hover .A_btn will select the class A_btn both in and . Tailwind solu…

So do you do sibling selectors by using the array index in a `.map` call?

Re: Why Tailwind CSS Won

#357

Earlier quoted context omitted.

>You're not learning anything valuable by learning Tailwind. Learn CSS, that will stick with you for the next 20 years. Tailwind maps onto CSS in a very straightforward way. I think you'd have to go out of your way to "learn Tailwind" without also improving your knowledge of CSS.

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'd say that the "stylesheets" part doesn't apply either.

Tailwind creates "stylesets", and is absolutely powerless to apply them. Quite like WYSIWYG text editors. So, yeah, anybody claiming you are learning CSS by using it doesn't really know CSS. But I disagree, that kind of thing can be useful on certain contexts.

Re: Why Tailwind CSS Won

#358
post #128

Earlier quoted context omitted.

What's up with the colocation argument? Colocation of markup and business logic makes a lot of sense. Colocation of presentation? Why do you even need that? Presentation is abstracted into CSS by design. Having presentation decoupled allows you to abstract around visual elements on a page at their instead of having to sufficiently wrap everything in divs classes just to the right level to make the CSs classes work.

The decoupling of CSS and HTML is a lie. HTML describes layout, not just content. Your overall structure is going to be vastly different whether you use flex or grid. And if you don’t want to write overly clever CSS you’re wrapping your dt/dd pairs in divs or you put dummy elements into your sections to control where the anchor links scroll to etc. And don’t get me started on non-hierarchical layout relationships. HT…

I never suggested decoupling html and CSS, that is always going to be coupled through selectors.

What I suggested was decoupling presentation (actual CSS rules) from structure, the blocks of html.

What I'm discussing here is if CSS rules should be inlined in html, whether through tailwind pseudo css or style tags the result is the same.

Further caveat, the article mentions that switching to a CSS file is a context switch. Put it in a style tags next to your html for all I care, colocation is great as a general rule, inlining CSS in html style attributes is not.

This is settled thinking at this point: inlining CSS results in short term benefits to productivity at the cost of long term costs due to brittle presentation that is expensive to change.

And given how low the cost of extracting reusable css classes is these days, I don't think tailwind will ever win.

Re: Why Tailwind CSS Won

#360
post #86
post #48

In the start-up space, Tailwind is to product UI as Bootstrap was (or still is) to marketing-focused landing pages. It almost serves as a litmus test as to whether you work in a start-up like environment or an enterprise environment. If you are in a design or product function in a enterprise company in non-tech industry, you steer clear from Tailwind. But, I appreciate its usefulness for developer's who just don't wa…

Could you explain why you’d steer clear from it in enterprise environments?

Purely from experience — largely, design system or development projects at large organisations are lead from a PMO, design or product teams — with technology often seen as down-stream (at least, in terms of development, there is of course technology architecture/advisory along the way.)

That means that the design/product requirements come first. The moment Tailwind's limitations meet design requirements, it'll take a back-seat.

It's basically the same reaction you'd encounter from saying "we'll build it in Bootstrap." If a company is investing in a new product or service, no one wants to be the guy that says "sorry our framework won't let us do that design" — at least, not in first year or two of a product life-cycle.

Tailwind's advantage — speed and accessibility for a range of developer backgrounds — isn't the same priority for large organisations vs. startups.

Post reply on HN