Re: [csswg-drafts] [css-scoping] Handling global name-defining constructs in shadow trees (#1995)

A simple scenario to explain why scope needs to be inherited is this:

Say a webpage defines a "my-font-family" font in the global style, and sets this font on the body, effectively setting that font to be inherited by all elements on the entire page. Somewhere on the page is a webcomponent, which inside it's shadowroot also defines a "my-font-family", and sets that font to be used on one of it's elements (but not all). If the scope would not be inherited, _all_ of the elements inside the custom element would now use the font defined in the shadowroot, which is clearly not intended.

If the scope would not be inherited, there is risk of naming collisions, and custom element authors would have to start namespacing their font names to avoid collision with other fonts defined in it's parent scopes. This is clearly not desired.

Can you provide a concrete example where the system with scope inheritance does not work as you expect it to?

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

Received on Wednesday, 22 May 2019 07:44:40 UTC