Live data from Hacker News

TailwindCSS v2.0

blog.tailwindcss.com

91–100 of 474 posts

Re: TailwindCSS v2.0

#91
I used to a skeptic, to the point where I thought it was completely ridiculous. Then I realized that I was over-using inline styles anyway since I was always afraid of messing with old CSS. I was adding layers of overwrites just not to accidentally change something unrelated.

Now I can't imagine myself ever writing regular CSS again. I just love how I can look at the HTML and instantly "visualize" how the component will look just by seeing the classes. No more mysterious cascades where it's hard to pinpoint where the styling is coming from. It makes iteration so fast and responsive design has never been easier.

Re: TailwindCSS v2.0

#92

Earlier quoted context omitted.

I could use sass to do the same.

Partially. You'll lose the system Tailwind gives you, which makes it easier to be consistent.

I handcraft that system myself.

It's like buy Ikea furniture and assembling it vs. having your own woodworking shop to handcraft furniture with precise requirements. These frameworks have made me lazy. I think CSS design is pretty much exactly the same as any craftsmanship job - there is so much pleasure from building it from the ground up. No, I still get the knots in the wood out by using reset.css.

Also, I try to not use class selectors as much as possible. HTML looks sterile and spartan with only a handful of span tags or id tags for very specialized targetted changes.

I can see why people use frameworks - its fast and quick. But you lose personality in the outcome.

Re: TailwindCSS v2.0

#93
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

That's literally the point: it's silly.

Re: TailwindCSS v2.0

#95
post #76

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.

that's ridiculous, why not just write padding: 2px 5px; display: flex; align-items: center; color: #fff; You are basically just creating a set of attributes that just mimic standard css properties, I find this approach of tailwind absolutely counter productive, and I am surprised that it gets so much popularity.

Quick FYI, py-2 is REM based, not pixel. So you know your design will fill properly.

Re: TailwindCSS v2.0

#96
post #83

Tailwind smells like using a style attribute but with properties that are fewer characters. It's fully embracing what everyone said to avoid. What am I missing?

What's the problem with style attributes? I would use them instead of regular CSS if I could add pseudo-attributes and make them responsive. Since I can't I use Tailwind where that's possible.

> What's the problem with style attributes? I would use them instead of regular CSS if I could add pseudo-attributes and make them responsive.

Imagine styling a table row. That is one style attribute. Now imagine styling a 100 tables rows. That is style attribute duplicated a 100 times. Think of the amount of unnecessary bandwidth consumed to load that HTML file with 100 duplicate style attributes. Not only does it slow down page load times, it also slows down page render times.

Now if you add selectors to style attributes then it solves the above issue altogether. But, then you are just re-inventing the wheel. Instead of CSS in a separate file you now have the same functionality but all inlined in style attributes.

Re: TailwindCSS v2.0

#97

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…

This is basically exactly what I get out of writing web components. I get the best of every possible dimension I care about. I can write short neat little snippets of code that encapsulates my HTML, CSS and JavaScript in a single place. I can do it just using really simple CSS because it is all scope, I can actually build reusable components, I’m using the native web platform (though I do recommend lit-element as well) and I can do all using modern tooling and JS and all of the benefits that brings.

Re: TailwindCSS v2.0

#98
post #55

Earlier quoted context omitted.

What benefit does having completely readable HTML offer?

The same benefit as any language you program in. Readability (not saying tailwind is hard, but it can be messy) is one of the most important things I look for.

If you use prettier or similar readability isn't an issue. I'd argue readability is improved since you can tell right away how an element is going to be displayed vs having to open up the css and look there.

Re: TailwindCSS v2.0

#99
I've been using tailwind for a chess game (https://github.com/JMS55/chessmatch) and so far it's been really good, and the first time CSS has clicked for me. My only complaint is that the html templates can get kind of messy, but that can probably be solved with @apply or splitting the template into pieces.

Re: TailwindCSS v2.0

#100

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.

I used it for my site here: https://www.listenaddict.com/

I've also used it for other various sites in the past.

Makes it trivial to add / change / design things quickly, which for me as a non-designer, is great. Also, works well to make things look good on mobile/tablet/desktop sizes, light and dark mode.

Post reply on HN