Re: [w3c/webcomponents] Provide a lightweight mechanism to add styles to a custom element (#468)

@rakina regarding the proposal, I still think that the "behaves as first in the stylesheet list of a shadow root" bit is not really great. I'm still not sure how specificity should work in your explainer. It says:

> The default styles will borrow Shadow DOM cascading order. The default styles will be treated as if they are the first stylesheets in the custom element's shadow root's stylesheets, if exists. 
> * For example, if we do this:
> ```js
>   let shadowRoot = myElement.attachShadowRoot({ mode: 'open'});
>   shadowRoot.innerHTML = '<style> :host { color: green; } </style>';
> ```
> Then the text in my-element will be colored green instead, because the shadow root style has priority since it comes later in the stylesheet list.

But that's not how stylesheets would work in a Shadow root. If you had a `#host` selector that hypothetically matched the host, then it would override any `:host` selector, as it'd be more specific. What's the specificity of the selectors in that stylesheet expected to be? Is it cascaded in a separate step instead?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/468#issuecomment-430902430

Received on Thursday, 18 October 2018 07:22:27 UTC