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

I really like this idea too, though it might be worth having a custom element-specific stylesheet instead:

```javascript
let sheet = document.createElement('style');
sheet.textContent = ':host { display: block; }';
customElements.define("cool-element", CoolElement, { styleSheet: sheet });
```

This way you can retain a reference and add to, remove or modify the css rules in a familiar manner later if required.

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

Received on Wednesday, 30 March 2016 08:34:25 UTC