feat(docs): add codepen for constructable stylesheets
This commit is contained in:
parent
8d46650c27
commit
c8c8eb90f3
1 changed files with 2 additions and 0 deletions
|
@ -57,6 +57,8 @@ customElements.define('styled-elements', StyledElement)
|
||||||
|
|
||||||
If you [use the Shadow DOM](/shadow-dom), you can add a `static styles` property of type string which will be added in the `shadowRoot`'s [`adoptedStylesheets`](https://developer.mozilla.org/en-US/docs/Web/API/Document/adoptedStyleSheets).
|
If you [use the Shadow DOM](/shadow-dom), you can add a `static styles` property of type string which will be added in the `shadowRoot`'s [`adoptedStylesheets`](https://developer.mozilla.org/en-US/docs/Web/API/Document/adoptedStyleSheets).
|
||||||
|
|
||||||
|
Try it now with this [example on CodePen ↗](https://codepen.io/ayoayco-the-styleful/pen/JojmeEe?editors=1010)
|
||||||
|
|
||||||
```js
|
```js
|
||||||
class StyledElement extends WebComponent {
|
class StyledElement extends WebComponent {
|
||||||
static shadowRootInit = {
|
static shadowRootInit = {
|
||||||
|
|
Loading…
Reference in a new issue