3 ms·
The author is advocating for rules like "body > header" in separate css files.
by sbergot 3y ago
The author is advocating for rules like "body > header" in separate css files.
- tipiirai 3y agoIndeed! I'm a freak using CSS as intended :)
- kaba0 3y agoThe problem is that CSS’s intended usage is broken, and never lived up to expectations.
- tipiirai 3y agoI think CSS does a good job at separating structure from presentation. Or what do you think was the original intention? Do you think Tailwind fixed the core issue with CSS?
- kaba0 3y agoI really recommend you reading the blog post by tailwind’s creator himself: https://adamwathan.me/css-utility-classes-and-separation-of-concerns/ https://adamwathan.me/css-utility-classes-and-separation-of-... Your “semantic” CSS depends on your HTML structure. Tailwind’s HTML depends on a fixed set of CSS styles. None is any more coupled than the other, it’s just that the direction of the dependence is different. Depending on what is expected to change more, both can be a valid approach: e.g. for a blog post that only uses heading, emphasis, link, styling it from CSS alone is definitely the best choice (that’s what it was developed for). But I would argue, most real-world web applications see more HTML-changes, and thus the other direction may make more sense.
- tipiirai 3y agoFully aware of this post. It's well written and I can see why people follow his stance. But I don't share Adam's history and experiences with semantic CSS. I genuinely want to separate structure from styling and not end up to this situation: https://nuejs.org/blog/tailwind-vs-semantic-css/img/markup-big.png https://nuejs.org/blog/tailwind-vs-semantic-css/img/markup-b...