3.1.2 • Published 2 months ago

@joist/element v3.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Element

Create a shadow root and apply styles and html as defined

Installation:

npm i @joist/element

Example:

import { tagName, shadow, css, html, attr, listen, element } from '@joist/element';

@element
export class MyElement extends HTMLElement {
  // define a custom element
  @tagName static tagName = 'my-element';

  // apply styles to shadow dom
  @shadow styles = css`
    :host {
      display: block;
      color: red;
    }
  `;

  // apply html to shadow dom
  @shadow template = html`
    <slot></slot>
  `;

  // define attributes
  @attr accessor value = 0;

  // listen for events
  @listen('click') onClick() {
    console.log('clicked!')
  }
}
3.1.2

2 months ago

3.1.1

2 months ago

3.1.0

2 months ago

3.0.8-next.0

2 months ago

3.0.8-next.1

2 months ago

3.0.0-next.19

11 months ago

3.0.0-next.18

11 months ago

3.0.4

6 months ago

3.0.7

6 months ago

3.0.6

8 months ago

3.0.0

8 months ago

3.0.0-next.20

11 months ago

3.0.0-rc.2

11 months ago

3.0.0-rc.1

11 months ago

3.0.0-next.11

12 months ago

3.0.0-next.10

12 months ago

3.0.0-next.13

12 months ago

3.0.0-next.12

12 months ago

3.0.0-next.2

12 months ago

3.0.0-next.1

12 months ago

3.0.0-next.4

12 months ago

3.0.0-next.3

12 months ago

3.0.0-next.15

12 months ago

3.0.0-next.14

12 months ago

3.0.0-next.16

12 months ago

3.0.0-next.9

12 months ago

3.0.0-next.6

12 months ago

3.0.0-next.5

12 months ago

3.0.0-next.8

12 months ago

3.0.0-next.7

12 months ago

3.0.0-2

12 months ago

2.0.0-next.2

2 years ago

2.0.0-next.1

2 years ago