3.9.2 • Published 8 months ago

@joist/element v3.9.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 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!')
  }
}
4.0.0-next.13

8 months ago

4.0.0-next.11

9 months ago

4.0.0-next.12

9 months ago

3.9.2

9 months ago

4.0.0-next.10

9 months ago

4.0.0-next.9

10 months ago

3.9.1

11 months ago

3.9.0

11 months ago

3.4.0

11 months ago

4.0.0-next.8

10 months ago

4.0.0-next.7

10 months ago

4.0.0-next.6

10 months ago

3.8.0

11 months ago

3.6.0

11 months ago

4.0.0-next.1

11 months ago

4.0.1-next.1

11 months ago

4.0.1-next.0

11 months ago

4.0.0-next.5

10 months ago

4.0.0-next.4

11 months ago

4.0.0-next.3

11 months ago

4.0.0-next.2

11 months ago

3.7.0

11 months ago

3.5.0

11 months ago

3.2.1

1 year ago

3.2.0

1 year ago

3.1.2

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

3.0.8-next.0

1 year ago

3.0.8-next.1

1 year ago

3.0.0-next.19

2 years ago

3.0.0-next.18

2 years ago

3.0.4

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.0

2 years ago

3.0.0-next.20

2 years ago

3.0.0-rc.2

2 years ago

3.0.0-rc.1

2 years ago

3.0.0-next.11

2 years ago

3.0.0-next.10

2 years ago

3.0.0-next.13

2 years ago

3.0.0-next.12

2 years ago

3.0.0-next.2

2 years ago

3.0.0-next.1

2 years ago

3.0.0-next.4

2 years ago

3.0.0-next.3

2 years ago

3.0.0-next.15

2 years ago

3.0.0-next.14

2 years ago

3.0.0-next.16

2 years ago

3.0.0-next.9

2 years ago

3.0.0-next.6

2 years ago

3.0.0-next.5

2 years ago

3.0.0-next.8

2 years ago

3.0.0-next.7

2 years ago

3.0.0-2

2 years ago

2.0.0-next.2

4 years ago

2.0.0-next.1

4 years ago