@joist/styled
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Styled

Apply css to a shadow root. Will apply constructable stylesheets if available and fallback to <style> elements if not.

Installation:

npm i @joist/styled

Example:

import { styled, css } from '@joist/styled';

@styled
export class MyElement extends HTMLElement {
  static styles = [
    css`
      :host {
        display: block;
        color: red;
      }
    `
  ]
  constructor() {
    this.attachShadow({ mode: 'open' });
  }
}

Package Sidebar

Install

npm i @joist/styled

Weekly Downloads

2

Version

2.0.1

License

MIT

Unpacked Size

5.61 kB

Total Files

9

Last publish

Collaborators

  • deebloo