> What is it with you and nesting? We were talking about scoping styles to a component.
I get where you coming for. But the issue that the scoping[0] you're referring to on your other comment is something I've never encountered or heard someone complain about.
In my mental model, an element owns it subtree in terms of styling. Meaning that, if I a component can be placed either statically or dynamically, then it belongs to all the elements that may be its parent. And if it want independent styles, then I reset it at the root of the component. So I assumes, any style property that is not set at the root of any element is inherited from the parent.
No need for elaborate syntax and mechanisms that just drive up the complexity of the code.
> But the issue that the scoping[0] you're referring to on your other comment is something I've never encountered or heard someone complain about.
Why do you think BEM exists? Or CSS-inJS? Why do you think web components exist?
All these are attempts to actually do what you claim css is already doing: to make sure that the element owns its subtree in terms of styling.
CSS is global.
> So I assumes, any style property that is not set at the root of any element is inherited from the parent.
Of course not. The hint is in the name: Cascading stylesheets. Your "owned" subtree is owned by every single element above up to and including document root.
> No need for elaborate syntax and mechanisms that just drive up the complexity of the code.
There's nothing complex about Tailwind. It actually reduces all the complexity to a set of small primitives. And since it's still CSS, you can write your own CSS as you wish.
What is it with you and nesting? We were talking about scoping styles to a component.
> CSS isn’t an imperative language. It’s a declarative one.
So what? Doesn't mean you can't provide nice declarative ways of doing things. Like SASS has provided for 20+ years.
> Which is what Tailwind is replicating.
I fail to see the logic or, indeed, the meaning of your assertion.