Skip to content

cfware/shadow-element

Repository files navigation

@cfware/shadow-element NPM Version

My uhtml based shadow element

Usage

This module makes use of public class fields.

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

class MyElement extends ShadowElement {
	static [adoptedStyleSheets] = [
		css`
			:host {
				background: blue;
			}
		`
	];

	get [template]() {
		return html`I'm blue`;
	}
}

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