The author is advocating for rules like "body > header" in separate css files.
Indeed! I'm a freak using CSS as intended :)
The problem is that CSS’s intended usage is broken, and never lived up to expectations.
I 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?
I really recommend you reading the blog post by tailwind’s creator himself: 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.
Fully aware of this post. It's well written and I can see why people follow his stance. But I don't share the same history / experiences with semantic CSS than Adam. I genuinely prefer to separate structure from styling and not end up to this situation:
https://nuejs.org/blog/tailwind-vs-semantic-css/img/markup-b...
Isn't "CSS scoped to components" nowadays a basic feature of frameworks?