Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cfware/shadow-element

My uhtml based shadow element
https://github.com/cfware/shadow-element

Last synced: 29 days ago
JSON representation

My uhtml based shadow element

Awesome Lists containing this project

README

        

# @cfware/shadow-element [![NPM Version][npm-image]][npm-url]

My uhtml based shadow element

## Usage

This module makes use of public class fields.

```js
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');
```

[npm-image]: https://img.shields.io/npm/v/@cfware/shadow-element.svg
[npm-url]: https://npmjs.org/package/@cfware/shadow-element