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

Thanks.

> * Styling elements that do not otherwise need a shadow root

Could you give us a concrete list of those elements?

> * Sharing styling across elements

We (WebKit) already have a plan to implement an optimization similar to the one @domenic pointed out without needing this new API.

> * Most importantly, because it does not work inside shadow trees. When you use a <button> inside a shadow tree, it is styled, but with the above solution, a <my-element> inside a shadow tree stays display: inline, since the my-element selector cannot reach inside shadow trees.

The solution here is to attach a shadow root on a custom element where such rules need to be applied.  Note that we've repeatedly and consistently opposed to having type extensions supported in custom elements so we're less sympathetic to the argument that this is needed for builtin elements that don't support shadow roots.

> * Less importantly, but still interestingly, is that the precedence of such stylesheets is higher than the usual precedence of "user agent stylesheets" in the cascade. This has various subtle undesirable side effects.

Could you list a concrete use case and what those undesirable side effects are?

---
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-214923010

Received on Tuesday, 26 April 2016 23:51:04 UTC