Live data from Hacker News

TailwindCSS v2.0

blog.tailwindcss.com

21–30 of 474 posts

Re: TailwindCSS v2.0

#21
TailwindCSS is great but I wish it didn't require custom postcss build pipeline. You can use the prebuilt css file, but it lacks some features.

Re: TailwindCSS v2.0

#22

What kind of projects do people use Tailwind for? and what's the general role of the person using it? I haven't found a use for it myself as a predominantly front-end dev but I've met a few devs who like it a lot but found that they were generally less comfortable writing plain css without a framework. No shade towards Tailwind intended, just not a paradigm I've gotten on board with yet and trying to understand.

Any type of project. Before Tailwind existed, I used a similar system but Tailwind is obviously more complete than what I'd roll in a week. I really don't think of it as a framework since you're still specifying which CSS properties you want to apply, just indirectly via classes.

Re: TailwindCSS v2.0

#23
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 other great frameworks, naming conventions and approaches that people use. Or start from scratch and roll your own.

For frameworks I flirted with InuitCSS for a bit. It's pretty nice and after digging through the code I realized it's not as complex as it first appears.

I also like Andy Bell's approach with Cube CSS.

Re: TailwindCSS v2.0

#24

What kind of projects do people use Tailwind for? and what's the general role of the person using it? I haven't found a use for it myself as a predominantly front-end dev but I've met a few devs who like it a lot but found that they were generally less comfortable writing plain css without a framework. No shade towards Tailwind intended, just not a paradigm I've gotten on board with yet and trying to understand.

We use it for a large enterprise webapp. We have a component library that uses react and applies the correct classes to the component there. I came from mostly using styled-components (CSS-in-JS) and tailwind has worked pretty well for us. The benefit of tailwind over css-in-js is primarily one of performance.

The downside is all styling gets shoved into the `className` prop which isn't great. If I had full automonomy to choose the css "framework" I would probably opt for something like `rebass` https://rebassjs.org/

Re: TailwindCSS v2.0

#25

I've gone through the following phases: 1. Write old school circa 2008 CSS. 2. Oh shit, it's a real pain in the ass to do layout and make a responsive grid. Let me use a framework. Sweet! 3. Hmm.. its kinda painful to write css selectors all day long. They're reusable but I am having to get out of comfy JS IDE setup to go change some CSS properties in a different file. 4. Tailwind arrives. OMG. This is awesome! Never…

I miss CSS compilers like SCSS/LESS on your vita ;-)

Basically the best way to do CSS I ever worked with was using Bootstrap the LESS way. You could use a sean HTML code with semantic (=speaking) class names and basically do the mapping to bootstrap classes within LESS. This was subsequently compiled to short CSS code. The best of all worlds.

I guess the CSS framework SemanticUI has a similar idea in mind. However, most people use it in the same way as Tailwind. This is web technology as it was done 10+ years ago, when people mixed markup and styling. It's a pity that young folks don't know...

Re: TailwindCSS v2.0

#26
post #17

Using `yarn upgrade tailwindcss` only brought me up to 1.9.6. I had to specify the version to get it to upgrade.

I would assume it's by design. A simple upgrade would potentially break at the very least the colors that you're using (they updated the built-in color palette).

Re: TailwindCSS v2.0

#27
For those complaining about dense HTML using Tailwind, the headline feature of 2.0 should be @apply for everything: https://tailwindcss.com/docs/functions-and-directives#apply

It lets you move all of those excessive class attributes into your CSS, where it realistically belongs. And that makes your CSS look a little more like CSS. But you get guard rails on it by applying a known set of properties to each rule. It's really the best of all worlds.

Re: TailwindCSS v2.0

#28

> Extra wide 2XL breakpoint, for designing at 1536px and above Is it still common for folks to use pixels in their CSS? I moved to em and the rest around 1999 (I think). What is the reason to stick to pixels?

Most people use rem these days, but there are common browser bugs with using rems or ems in media query rules, so in the rules specifically it is common to still specify pixels, even if the rest of your stylesheet uses rems or ems.

Re: TailwindCSS v2.0

#29

> Extra wide 2XL breakpoint, for designing at 1536px and above Is it still common for folks to use pixels in their CSS? I moved to em and the rest around 1999 (I think). What is the reason to stick to pixels?

Also the magnificent rem (root em) unit.

Re: TailwindCSS v2.0

#30
post #26
post #17

Using `yarn upgrade tailwindcss` only brought me up to 1.9.6. I had to specify the version to get it to upgrade.

I would assume it's by design. A simple upgrade would potentially break at the very least the colors that you're using (they updated the built-in color palette).

That's understandable, but they didn't clarify that at all in the upgrade instructions, which say to just use "npm install tailwindcss" to upgrade.

edit: And it also broke PostCSS somehow. What a mess!

edit 2: I just noticed the "@latest"

Post reply on HN