Re:Tailwind: style your site without writing any CSS
by wishinghand on Friday November 02, 2018 @11:32AM
(#18363730)
This can easily be accomplished with SASS and a methodology like BEM. And it makes the markup a lot easier to read.
[ Parent
| on HN ]
Re:Tailwind: style your site without writing any CSS
by dna113 on Friday November 02, 2018 @11:41AM
(#18363796)
If you prefer that great, which is why I said that I don't think it makes a huge difference one way or another.
.i-dont__find-bem--very-readable.
Re:Tailwind: style your site without writing any CSS
by duhi88 on Friday November 02, 2018 @11:50AM
(#18363904)
Sass makes it a lot nicer to write BEM notation. The long class names used to bother me too, but it is actually much nicer than not knowing where a class came from. Is `.right-button` a global button style, or unique to this component?
Re:Tailwind: style your site without writing any CSS
by dna113 on Friday November 02, 2018 @11:58AM
(#18364000)
I agree that sass enables nice readable BEM, but I don't really think that BEM makes markup any easier to read than something like tailwind.
If you're into knowing where your class came from, it seems tailwind would be even better for you because now you have access directly to your styles right there in your markup. Skip the class step altogether!
Re:Tailwind: style your site without writing any CSS
by hinkley on Friday November 02, 2018 @12:27PM
(#18364325)
Wouldn’t you know that if the Sass is indented?
I treat my name spacing the way I do in most source code. All the code for a unit is in the same file or in files called out from that file.
If you’re not nesting in Sass you’re missing out on some of the better parts.
Re:Tailwind: style your site without writing any CSS
by stefanfisk on Friday November 02, 2018 @11:38AM
(#18363778)
after doing a project with tailwind I have completely abandoned the idea of BEM. while it was nice having clean classes, having the styles directly in the html is way easier to reason about.
Re:Tailwind: style your site without writing any CSS
by colonelpopcorn on Friday November 02, 2018 @12:06PM
(#18364083)
We're back to filling in style attributes on each tag, aren't we?
Re:Tailwind: style your site without writing any CSS
by nihonde on Friday November 02, 2018 @12:49PM
(#18364554)
Not quite, because you can still define thematic defaults and change those globally to suit any changes to your style book.
Re:Tailwind: style your site without writing any CSS
by defenestration on Friday November 02, 2018 @11:58AM
(#18363997)
I have the same experience. After working four years with BEM, we switched to atomic css. We only use BEM for big components. It has been a delight.