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

(Sorry, pressed enter too early)

> We borrow an existing cascading order, Shadow DOM cascading order, as the cascading order of the custom element default style here so that we can avoid introducing new cascading order. We might want to call it "fake shadow dom cascading order"; Its cascading order is defined as if the custom element default style was defined at the first position of its pseudo shadow root.

I'm not sure I understand the implications of this: What's the proposed behavior of a custom element with default style and a shadow host? What's the behavior of `!important` on the default style?

Does it effectively act as a `<style>` element in the first position in the list of the shadow host? That's what I understood, but I want to confirm.

That sounds slightly annoying to implement (with a Gecko hacker hat on), and somewhat confusing to reason about (if I add an `!important` `:host` rule in a shadow root it may or may not necessarily override the custom element style, depending on how we define specificity of `:element` and what not).

If I understand correctly the reason shadow importance computation is like it is is so the shadow could override everything if needed, is that no longer something we want?

Looks to me that it would be much easier to define as a cascade order right before the shadow root instead of reusing something it might conflict with... But I saw that @rniwa was very opposed to that (I'm curious about why, it seems the most straight-forward way to implement this to me off-hand).

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

Received on Monday, 23 July 2018 15:52:02 UTC