Re: [csswg-drafts] [css-scoping] Please bring back scoped styles (#3547)

@keithjgrant thanks for your reply that's useful information! I never looked at the `@scope` proposal. 

Correct me if I am wrong: when using the inline (html attribute) version would styles cascade? If yes even in the case of `#foo p` inside of a `#bar b` the former would be `blue` and vice versa. Unless you meant that in the "inline" version the inner scope always wins regardless of the specificity (I can imagine that being true for the at-rule version).

Either ways the problem I am talking about is that with this model and no lower boundaries (like in JS components or Shadow DOM) it is impossible to stop styles to leak into the entire subtree. The perfect example is you are making a website using some templating system. A partial has a `p` that you didn't mean to style but `@scope .foo { p { margin: 20px } }` will match that and possibly break something (in your example you always reset but that's not always the case). Not sure if it is clear what I am trying to say.

-- 
GitHub Notification of comment by giuseppeg
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3547#issuecomment-458224150 using your GitHub account

Received on Monday, 28 January 2019 17:28:01 UTC