News for hackers. Stuff that matters.
Re:Tailwind: style your site without writing any CSS by mattferderer on Friday November 02, 2018 @10:23AM (#18363211)
If this article didn't make it click for you, that's understandable. It took me a long time of hearing about this & thinking it was stupid before it made sense. When that happens to me, it's usually a sign of something good.

The author of Tailwind suggested I read his best effort at explaining why this makes sense.: https://adamwathan.me/css-utility-classes-and-separation-of-...

Towards the end of the article it started clicking for me.

Re:Tailwind: style your site without writing any CSS by paulsutter on Friday November 02, 2018 @11:20AM (#18363640)
Easier just to quote the reason he gives:

“With inline styles, there are no constraints on what values you choose... Utilities force you to choose...

You can't just pick any value want; you have to choose from a curated list. Instead of 380 text colors, you end up with 10 or 12.”

Re:Tailwind: style your site without writing any CSS by ealhad on Friday November 02, 2018 @11:47AM (#18363866)
And of course, those colors are fully customizable.
Re:Tailwind: style your site without writing any CSS by jacamat on Friday November 02, 2018 @12:49PM (#18364551)
in what way is that consistent tho?
Re:Tailwind: style your site without writing any CSS by neurotrace on Friday November 02, 2018 @02:05PM (#18365238)
In what way is it not? You'll consistently get 10 or 12 colors instead of getting an inconsistent set of colors, for example.
Re:Tailwind: style your site without writing any CSS by jacamat on Friday November 02, 2018 @05:24PM (#18366904)
But I only want the element to be the color it IS, not a range of colors it could be. Whats to stop a dev using $concrete when they should be using $cloud? or $linkGray instead of $headerLinkGray?

these inconsistencies compound, especially across teams.

Re:Tailwind: style your site without writing any CSS by neurotrace on Tuesday November 06, 2018 @02:00PM (#18393909)
Nothing would stop them from choosing to use cloud vs. link gray but it's far easier to identify and fix those cases than it is to have #CCC, lighten(#CCC, 10%), etc. around the codebase. This doesn't fix human error, just reduces it.
Re:Tailwind: style your site without writing any CSS by akvadrako on Friday November 02, 2018 @11:23AM (#18363657)
I admit, after the middle of that article anything would look good.

It's a good realisation that there is no real separation of semantics and styling between HTML and CSS. XSL would have been one solution, but it was just too XML-ly. Personally I found it a joy; I could design my pages with pure semantics alongside a turing-complete stylesheet.

However now we have web components - your HTML and CSS are tightly coupled, but scoped. And the semantic / styling separation is provided by the shadow DOM. So no need to create inner platforms like Tailwind.