- From: Tomek Wytrębowicz <notifications@github.com>
- Date: Tue, 27 Mar 2018 13:51:26 +0000 (UTC)
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 27 March 2018 13:51:49 UTC
@TakayoshiKochi https://github.com/w3c/webcomponents/issues/468#issuecomment-371453775 > E.g. Imagine <cool-list> and <cool-item>, both are quite dumb custom element that only needs styling. But specifically, <cool-list> wants to have style for <cool-item> when they are direct children under the element. Personally, I'd implement it as: ```js var listcss= new CSSStyleSheet(':host { ... (A)}'); customElements.define('cool-list', MyElement, { stylesheet: listcss}); var itemcss = new CSSStyleSheet(':host { ... (B)}, :host-context(cool-list) { ... (C)}'); customElements.define('cool-item', MyElement, { stylesheet: itemcss }); ``` However, I'd say being able to do something like below, would be intuitive. ```css customElements.define('cool-list', MyElement, { stylesheet: new CSSStyleSheet(` :scope { ... (A)}, :scope > cool-item { ... (C)} `);}); ``` -- 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-376532554
Received on Tuesday, 27 March 2018 13:51:49 UTC