Live data from Hacker News

Why Tailwind CSS Won

matt-rickard.com

11–20 of 559 posts

Re: Why Tailwind CSS Won

#11
I don't get Tailwind. In my book, CSS is here to facilitate the style of multiple webpages by modifying a set of rules, and classes are here to mutualise said rules.

With Tailwind, it looks like you design by writing HTML, which is the opposite of what CSS aims at. So if you wish to change your design, you'll have to update multiple templates instead of one CSS rule.

Every time I've had to work with Tailwind, it felt like a chore and it was an unpleasant experience.

Re: Why Tailwind CSS Won

#12
post #8

For me it won because I view tailwind as vanilla CSS with a nicer syntax (mostly) and sane defaults that makes your website look decent out of the box. With the prettier autosorting plugin, the classes are ordered in a predictable fashion, making it easier to read than one would imagine. It's not a perfect replacement for vanilla CSS and I still fall back down to writing plain old CSS for stuff like box shadows or mo…

Your last paragraph should be all the reason you should use "plain old CSS".

Re: Why Tailwind CSS Won

#13
post #8

For me it won because I view tailwind as vanilla CSS with a nicer syntax (mostly) and sane defaults that makes your website look decent out of the box. With the prettier autosorting plugin, the classes are ordered in a predictable fashion, making it easier to read than one would imagine. It's not a perfect replacement for vanilla CSS and I still fall back down to writing plain old CSS for stuff like box shadows or mo…

Tangential, thinking aloud:

The "default" (no css) look of HTML pages with black on white Serif text with default paddings / margins / spacing...must also have been picked at the time to make web pages look pretty (in a generic sense) out of the box? Just that we have now evolved in our sense of visual design tastes / whats possible has changed over the decades, maybe.

Re: Why Tailwind CSS Won

#14
For getting designs up and running quickly, it really is great.

Being able to think "Hmmm, I want a rounded button, with a border and a blue background" and just typing class="rounded border border-blue-600 bg-blue-500" and it's done.

With lots of UI being components now, it doesn't really matter that it is verbose - I actually find that helpful. And even if you want to have a class that you use all over the place, just use @apply and create a custom class that you can use anywhere.

One place it can be hard to use, is if you have a specific design system - then yea at that point you either work with Tailwind and modify the config to match, or you just go with standard CSS - but at that point it probably makes sense.

Re: Why Tailwind CSS Won

#15
post #11

I don't get Tailwind. In my book, CSS is here to facilitate the style of multiple webpages by modifying a set of rules, and classes are here to mutualise said rules. With Tailwind, it looks like you design by writing HTML, which is the opposite of what CSS aims at. So if you wish to change your design, you'll have to update multiple templates instead of one CSS rule. Every time I've had to work with Tailwind, it felt…

In a recent thread someone explained Tailwind was best used with component frameworks, and that made it make a lot more sense and I could see the appeal.

Re: Why Tailwind CSS Won

#16
post #11

I don't get Tailwind. In my book, CSS is here to facilitate the style of multiple webpages by modifying a set of rules, and classes are here to mutualise said rules. With Tailwind, it looks like you design by writing HTML, which is the opposite of what CSS aims at. So if you wish to change your design, you'll have to update multiple templates instead of one CSS rule. Every time I've had to work with Tailwind, it felt…

> if you wish to change your design, you'll have to update multiple templates instead of one CSS rule.

this comes up on every tailwind post and it isn't true. tailwind encourages you to not repeat yourself by making reusable components (or fragments etc) instead of reusable classes. that way if I want to see how the button both looks and works I only have one place to look

even if you don't do this, with tailwind you encode your design system (colours, spacing) etc in the config file so even copy pasting everything will get you something consistent

https://tailwindcss.com/docs/utility-first#maintainability-c...

Re: Why Tailwind CSS Won

#17
post #11

I don't get Tailwind. In my book, CSS is here to facilitate the style of multiple webpages by modifying a set of rules, and classes are here to mutualise said rules. With Tailwind, it looks like you design by writing HTML, which is the opposite of what CSS aims at. So if you wish to change your design, you'll have to update multiple templates instead of one CSS rule. Every time I've had to work with Tailwind, it felt…

In my understanding it somehow abstracts the process of styling a website or whatever and make it easy for people who for any reason don't want to write CSS.

Although I have the sensation many people find hard to write CSS and even despise it (I've read people here in HN who seem to think we should've kept doing layouts with HTML tables and don't agree layout is the job of CSS!) I definitely agree having dozens of classes in your HTML is messy and weird.

Re: Why Tailwind CSS Won

#18
I think Tailwind is more accessible to many[*] less experienced or CSS-oriented developers. Big generalisation, I know, please don't yell at me, but many of us can get 99% of Tailwind's value with UI libraries supporting:

1) style encapsulation,

2) colocated presentation/content/behaviour and

3) a more minimalist mindset/habits when building UIs (e.g. relying on simpler styling hierarchies, native DOM elements, semantic HTML instead of div soup).

[*] not all, it doesn't mean that it doesn't make "senior" (whatever that means) devs more productive or that if you're using Tailwind you'll lose your 10x dev of the month badge. But, CSS is a misunderstood yet very flexible language which means it can be used or abused in a huge variety of ways.

Re: Why Tailwind CSS Won

#19
post #11

I don't get Tailwind. In my book, CSS is here to facilitate the style of multiple webpages by modifying a set of rules, and classes are here to mutualise said rules. With Tailwind, it looks like you design by writing HTML, which is the opposite of what CSS aims at. So if you wish to change your design, you'll have to update multiple templates instead of one CSS rule. Every time I've had to work with Tailwind, it felt…

In a recent thread someone explained Tailwind was best used with component frameworks, and that made it make a lot more sense and I could see the appeal.

Still can't see it. Once you do components CSS gets much simpler, what's the point of a layer on top?
Post reply on HN