Live data from Hacker News

Tailwind: style your site without writing any CSS

jvns.ca

41–50 of 185 posts

Re: Tailwind: style your site without writing any CSS

#41
A neat concept — perhaps two years too late.

I fear that many will not prefer attribute bloat in their markup.

And many are moving to React, does this sort of toolset matter anymore? Not being negative, genuinely serious. Does this tool make sense for apps going forward? To me it seems Tailwind is for little html things.

Re: Tailwind: style your site without writing any CSS

#42
post #33

Earlier quoted context omitted.

Oh no, laziness! Someone is doing something in an easy and convenient way that somehow doesn't match up with other people's ideals of conceptual purity! :'(

Bloating your markup with classes is simply a bad habit. It bites you hard in the long run. Even the framework that they are using proposes better alternatives. “ Tailwind encourages a "utility-first" workflow, where new designs are initially implemented using only utility classes to avoid premature abstraction. While we strongly believe you can get a lot further with just utilities than you might initially expect, w…

> It bites you hard in the long run.

How so? If what I need is (as the author describes) to occasionally make a quick relatively-usable site, and I want to do some styling on it, and then forget about frontend UX until I need to do another small site 4 months from now, how will this pattern bite me?

Re: Tailwind: style your site without writing any CSS

#43

I really like these atomic/functional css libraries with any sort of frontend framework or templating system that leverages components. Personally, I have been using Tachyons with React for the past couple months, and it's been a blast. Compared to writing html templates with Emmet and css with Sass, I feel as if I am more productive and like I can reuse more components. It's worth a try if it interests you!

I've also found Tachyons & React to be an amazing combination. The only trouble I've had is extracting common CSS class strings into tweakable components, e.g. a whose background color you can easily override, or a with tweakable font weight.

I wrote a tiny (1kb) library to make this easier. For anyone working with React and functional CSS, I hope it's helpful:

https://www.npmjs.com/package/nanostyled

Re: Tailwind: style your site without writing any CSS

#44

I use Bulma (discussed at the end) for all my projects. It's very easy and quick to get started with, but I found myself diverging from this style when I was starting to add new CSS of my own, to get the pages to look exactly how I wanted them. And due to the lack of tooling, it's hard to refactor CSS (removing duplicate code, etc.) so I'm not sure how scalable it is to adhere to what the OP says for a long time.

I used Bulma as a way of getting up to speed after a hiatus since circa 2001 when it comes to web stuff. I needed to quickly throw together a company site.

I searched around and Bulma seemed ... "not insane" which was good enough for me. And it is good, and good enough. But I can easily see how you could start fighting against Bulma if you wanted to do much customizing.

If I ever get caught between a rock and a hard place and need to do stuff not easily wrought in Bulma, I will check back on Tailwind.

Re: Tailwind: style your site without writing any CSS

#45
I've been saying for years that, in these days where all HTML is generated, CSS makes no sense and we might as well just style inline. You probably already have a "button" class in your UI framework that contains the HTML for rendering a button; put the styling there too.

Re: Tailwind: style your site without writing any CSS

#46
post #45

I've been saying for years that, in these days where all HTML is generated, CSS makes no sense and we might as well just style inline. You probably already have a "button" class in your UI framework that contains the HTML for rendering a button; put the styling there too.

So if you have a large number of buttons or other elements with the same class you will be repeating yourself over and over.

With elements with a large number of style rules, you add a lot of very long lines to your html.

This would be a nightmare to work on/maintain.

Re: Tailwind: style your site without writing any CSS

#47
Most (all?) of the classes apply exactly 1 line of CSS.

I see this as an anti-pattern, because to me it looks like inline styles with extra steps. The only thing it avoids is accidental strong specificity.

The reason we have CSS is that it's really easy to make HTML unreadable - after all it's essentially a 1D medium(lines of text) trying to describe a 2D space.

Re: Tailwind: style your site without writing any CSS

#48

A neat concept — perhaps two years too late. I fear that many will not prefer attribute bloat in their markup. And many are moving to React, does this sort of toolset matter anymore? Not being negative, genuinely serious. Does this tool make sense for apps going forward? To me it seems Tailwind is for little html things.

If anything, utility CSS frameworks and creating reusable CSS (as opposed to reusable HTML) make more sense when used with something like React.

Re: Tailwind: style your site without writing any CSS

#49
post #45

I've been saying for years that, in these days where all HTML is generated, CSS makes no sense and we might as well just style inline. You probably already have a "button" class in your UI framework that contains the HTML for rendering a button; put the styling there too.

So if you have a large number of buttons or other elements with the same class you will be repeating yourself over and over. With elements with a large number of style rules, you add a lot of very long lines to your html. This would be a nightmare to work on/maintain.

CSS sucks because it lets you reuse code to a very small degree, but doesn't go very far. Less or sass seem much betters, if for no other reason than referencing common behavior.
Post reply on HN