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

Since `attachShadow` has been mentioned various times, and since that does not really need a constructible ShadowRoot (illegal indeed), how about:

```js
const style = element.attachStyle(optionalConfiguration);
```

We could have an `element.shadowStyle` or anything else that makes sense there, and the following benefits:

  * it is not strictly related to Shadow DOM
  * it has a friendly API, like Shadow DOM
  * it doesn't require any constructor

Thoughts ?

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

Received on Thursday, 8 March 2018 09:05:54 UTC