Live data from Hacker News

TailwindCSS v2.0

blog.tailwindcss.com

111–120 of 474 posts

Re: TailwindCSS v2.0

#111
post #48

Earlier quoted context omitted.

You can use postcss and @apply tag to compose single classes that you can use in your html code like .btn-blue .btn-blue { @apply py-2 px-5 flex items-center bg-blue-500 text-white rounded } So I don't really see that as a problem. You are supposed to refactor your styles later to be more reusable. What tailwind provides is fast iteration and design. I love that.

The exact problem is the 99% of people who DON’T do this and their markup ends up a Frankenstein’s monstrosity. I don’t know if it’s the new crop of front-end “developers” who don’t know the very basics or just hipsters being hipsters and YOLO all the things. Tailwind (IMHO) promotes bad practices and needs to explicitly state that you SHOULD use @apply or a puppy somewhere will die.

I'm a FE dev with 10 years experience.

I've only started using Tailwind specifically in the last year or so, but I've been using functional CSS for about 6 years.

I don't believe using @apply is a maintainable approach. A better approach is to use view templates. In fact Adam Wathan recommends this way too in this video https://youtu.be/J_7_mnFSLDg

Re: TailwindCSS v2.0

#112
post #104
post #68

Earlier quoted context omitted.

Tailwind themselves offer a paid one called TailwindUI[0]. It's still in early access, and I commonly run up against components that are missing and I have to devise a style for myself, but it provides a pretty good starting point for building out a clean looking web app. [0] https://tailwindui.com/

Pretty nice, thanks!

It's still pretty immature and buggy, so unless you have no problem fixing blocking issues yourself I'll suggest waiting until it becomes more mature.

Re: TailwindCSS v2.0

#113
I occasionally write HTML/CSS, and have always just grabbed Bootstrap, Pure, something. I've briefly looked at TailwindCSS a couple of times and always end up at: where are the some of the common, basic components? It seems like those are paid for items. Am I on the hook to be e.g. a button designer if I don't buy the bundle?

Re: TailwindCSS v2.0

#114
post #49

that video is quite aggressive.

It's so cringe i was thinking thats joke at first.

I guess that happens when you invest and hire some outside help and sometimes it ends up a bit... unsophisticated?

I am big Tailwind user btw.

Re: TailwindCSS v2.0

#115

The things I love the most about TailwindCSS: 1. After purged the CSS file is really, really small. 2. Hopping into all of my projects and not having to remember new class names. 3. Not having to come up with new class names. 4. Not worrying about making a change in a class and having unintended consequences. 5. Not skipping back and forth between HTML or CSS files. That said, if you don't dig it, there are plenty of…

> 5. Not skipping back and forth between HTML or CSS files.

What? I thought the point of this was for use with composable JS components.

You're manually writing and updating attributes like this?!

  class="text-4xl sm:text-6xl lg:text-7xl leading-none font-extrabold tracking-tight text-gray-900 mt-10 mb-8 sm:mt-14 sm:mb-10"
How could you possibly manage this without components? Ctrl-F "lg:text-7xl" and replace?

Re: TailwindCSS v2.0

#116

Tailwind is the most counterintuitive yet obvious-in-hindsight CSS tool (or of any class - no pun intended) I've worked with. I know the general sentiment towards Tailwind is "I spent years getting my separation of concerns with HTML/CSS down, but now you're telling me all that is backwards and CSS Zen Garden is blasphemy?" I was in the same boat. Tailwind just felt wrong, and with 15+ years of experience, I've come…

I'll identify as in the "not yet convinced" category on Tailwind (though, I have evolved on other paradigms, which I will now discuss). JSX felt wrong (at first) due to co-mingling HTML and JS, however, I realized that's the wrong application of concerns because 1. JSX isn't HTML, it's a sugared syntax for the React.createElement API and 2. that separation wasn't meaningfully improving my architecture and in retrospect was clearly holding us back. Could anyone evaluate if these are analogous 'separation of concerns' (SoC) fallacies?

I will admit, I think I never fully appreciated the intent of SoC.

Re: TailwindCSS v2.0

#117

Earlier quoted context omitted.

I think there are two reasons: - you can copy the classes from html directly into @apply (you need to tinker a bit more to get responsive/hover/etc classes to work, though) - you work with predefined values, so if you switch color in tailwind.config.js, it's gonna get correct value in the @apply class too. That's the way I see it

For the second one, couldn’t you get the same effect by just using css variables?

Sure you can and you should, right?

But this way you have to write couple of classes more, couple of variables more. And with Tailwind you just define/change value in the config and you have all the classes generated, so the changes are minimal.

Re: TailwindCSS v2.0

#118
post #4

Their marketing is good, they do a primo job at conveying the message in a nice looking way, but the end result is still HTML littered with hundreds classes, that gets hard to maintain and impossible to refactor.

I found the promotional video for v2.0 somewhat silly. Epic music taken almost from some Nolan trailer playing in the background for things like "New color palette", "New shades of Gray". Edit: here's a stark contrast of another promotional video for some tool doing a better job (IMO): https://www.youtube.com/channel/UCaNsjhUdh3BxFL6tzyuhc9g

Framework author here, yep the whole point of the trailer is to be absolutely ridiculous.

The music was custom scored for us by the best man at my wedding, and we had a professional opera singer record all of the chants at the end which are literally "utility first" in Latin.

It's completely outrageous and absurd :) It's the Old Spice commercial of launch videos.

Re: TailwindCSS v2.0

#119
post #51

Earlier quoted context omitted.

The problem I have with pure CSS is it relies on the fact that you and your team are experts at CSS, which is almost never the case. Pure CSS with an unexperienced developer can lead to spaghetti pretty quick. There are always limitations with any approach, including frameworks, but on a team with more than 1 developer and long term maintenance in mind I'd prefer to go with a framework more times than not.

I'm tired of this argument: train your devs for the job you have for them, or if they're not trainable, then find them another position not doing stuff they are incapable of. We're engineers, let's act like it and know our goddamn stuff, not dumb it down to the LCD.

This feels like the story of a lot of web tooling: accessibility over all else, especially performance/future maintenance. The fail-fast/move fast and break things culture of some startups bleeds into the aesthetics of tools. Knowledge of tools begins to be confused with skills. Ironically, it burdens new devs heaviest, as they're not able to sort through which concepts/abstractions that tools bring with them are worthwhile, and which are not.

It drove me away from the platform entirely.

(This isn't about Tailwind, I've never used it, so I can't comment on it.)

Post reply on HN