- From: Takayoshi Kochi <notifications@github.com>
- Date: Wed, 07 Mar 2018 20:04:18 -0800
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 8 March 2018 04:04:42 UTC
So in my understanding
```js
class MyElement extends HTMLElement {
constructor() {
super();
}
}
// if constructable stylesheet is a thing
var css = new CSSStyleSheet(':host { color: blue; }');
customElements.define('my-element', MyElement);
var my_element = document.createElement('my-element', css);
document.body.appendChild(my_element);
```
Then `color: blue` is applied to every `<my-element>`, although at this moment you have no way to retrieve the `CSSStyleSheet` object from the element itself.
and then,
```js
var root = my_element.appendShadow({mode: 'open'});
```
will make it appear in `root.styleSheets(0)`, such that
```js
root.styleSheets(0) === css
```
is true.
--
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-371372008
Received on Thursday, 8 March 2018 04:04:42 UTC