UNPKG

@joist/styled

Version:

Intelligently apply styles to WebComponents

31 lines (24 loc) 479 B
# Styled Apply css to a shadow root. Will apply constructable stylesheets if available and fallback to `<style>` elements if not. #### Installation: ```BASH npm i @joist/styled ``` #### Example: ```TS 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' }); } } ```