2 ms·
Maybe I'm not using the right terminology - definitely not an expert - but I think Tailwind is "utility based". When I said side step issues with class-based n
by asimpletune 5y ago
Maybe I'm not using the right terminology - definitely not an expert - but I think Tailwind is "utility based".
When I said side step issues with class-based natured of CSS, I meant there's really no way to leverage the cascading nature of CSS using tailwind. You don't even really write css in tailwind. Because of this you get code duplication, but your styling is super portable. This, I think, is the nature of using a utility based framework. You can literally copy and paste almost anything and it will probably work, because the specificity doesn't depend on any sort of class hierarchy or make any assumptions about the structure of your css classes.
They're basically inline styles but use class names that are designed to be more useful than just writing css inline. Basically a light amount of editorialization.
But like I said I don't really know, so if someone knows a better way to word what I'm trying to say please correct me. I think the tailwind creator said something like "the canonical way of writing 'modular' CSS just doesn't work" (I'm paraphrasing but something to this effect).
- e12e 5y agoSounds like we agree - you don't mean classes, you mean issues of cascading and specificity. See eg: https://alistapart.com/article/braces-to-pixels/ https://alistapart.com/article/braces-to-pixels/ for a brief overview / recap. The "other" options to utility/tailwind approach is to avoid classes, and use semantic html (easier in HTML5, where you can just decide you'll have an <article> with <lede> and <section>s) or heavily customized css classes (like bootstrap). Main difference between tailwind and bootstrap, is that bootstrap still assumes you'll have some container-elements that wrap other elements - while theoretically tailwind styles every element in isolation. (sort of)