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

Styles that behaves like styles in a shadow root may not be the same as astyles that are global for a given class constructor.

I think we need something like user-agent styles for the custom elements, that bleed through shadow roots. To avoid problems, maybe it can be rule based, and applies only to the element (no selector, just a set of rules for all instances of some custom element).

It should be associated with constructors, because if scoped custom element registries are a thing, we don't want to complicate that (f.e. having to define same classes for every registry or for ever sub class).

It seems hacky to treat these like styles in a shadow root. Are they going to be multiple instances (less performance) per CE? 

If they behave like user-agent styles, they only need to be defined once per class, and maybe subclasses can override them with matching static prop. HTML engine only needs to traverse the prototype once and use the style for all instances anywhere in the whole composed tree.

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

Received on Wednesday, 7 March 2018 16:45:36 UTC