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

Thanks. Given that the UA stylesheet-based approach is a new idea and we haven't discussed pros and cons about virtual-shadow-root vs the UA stylesheet-based yet, it is worth discussing.

I prefer the UA stylesheet-based approach which disallows complex selectors, in every aspects.

Rune also [prefers the UA stylesheet-based approach](https://chromium-review.googlesource.com/c/chromium/src/+/992074#message-ae5987929c9dd9373257d30a9f6d0a77ef266a2d), because it only allows compound selectors.

> For implementers, they can use either approach; they will not be observably different in a way that is observable by web-platform-tests. (Again, except for :host vs. *.)

I agree there is no *observable* difference (except for :host vs *), however, I have a concern that virtual-shadow-root approach can have observable effects, if a shadow root is attached. Implementers have to be aware of this case, and take care of this *side effect* anyway. That sounds an undesirable overhead to me.

>  Also !important rules set in UA stylesheets override !important rules in user stylesheets. It's highly undesirable for authors to be able to override !important rules in the user stylesheets.

Yup, I agree that this might be undesirable from a component users' perspective, however, that can be desiable from a component author's perspective. Actually, that matches built-in elements' UA style's behavior, which browser vendors provide. We have some `!important` UA rules which we don't want users to override. That are intentionally done.

I am a fan of any idea which makes custom elements closer to built-in elements as much as possible.

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

Received on Thursday, 5 April 2018 04:46:54 UTC