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

> Interesting! Do you think this more limited approach (just giving a stylesheet to a custom element) is sufficient, or do you still think we need the ability to target arbitrary elements with a compound selector? I can see arguments either way.

It looks that each solves the different use cases. If a selector used in "a stylesheet to a custom element" always have ":host" pseudo class, both approach might be able to address the original concern.

If ":host" is always used here, can we have more light-weight approach?

e.g. 
- Allow only a compound selector here.
- "*" only matches the custom element itself in this context.

```js
customElements.define("cool-element", CoolElement,
    {styles: "* {display: block; } *[red=true] {color: red; }");
```






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

Received on Thursday, 31 March 2016 08:07:00 UTC