3 ms·
I like this take! It confirms my issue with using tailwind. I like it! But as you mentioned “style” typically has a global, systematic, component based notion,
by dgb23 4y ago
I like this take!
It confirms my issue with using tailwind. I like it! But as you mentioned “style” typically has a global, systematic, component based notion, and not a hierarchical one.
A perfect example is typography AKA font style and color. Yes, it has a structural/hierarchical notion, but only on an abstract component level.
Typography almost _always_ comes in aggregates. Font size, line height and more, even margins - they are very rarely orthogonal and composable.
Designers typically take great care to fine tune these things as components. Ask a designer to disentangle then into tokens and you get a very weird look!
On the structural level you want meaningful component classes to refer to them and maybe one or two modifier classes, if at all.
Thankfully tailwind offers @apply, so you can still leverage some definitions where it makes sense.