@cfware/shadow-element

My uhtml based shadow element

Usage no npm install needed!

<script type="module">
  import cfwareShadowElement from 'https://cdn.skypack.dev/@cfware/shadow-element';
</script>

README

@cfware/shadow-element NPM Version

My uhtml based shadow element

Usage

This module makes use of public class fields.

import ShadowElement, {html, template, define} from '@cfware/shadow-element';

class MyElement extends ShadowElement {
    get [template]() {
        return html`
            <style>
                :host {
                    background: blue;
                }
            </style>
            I'm blue
        `;
    }
}

MyElement[define]('my-element');