custom-element-styles
Automatically inject styles into a custom element's Shadow DOM once it's created.
Similar to insert-css, except for custom elements.
Usage
styles(Element, css)
Applies the css
styles when a ShadowRoot
is created on the Element
custom
element.
const styles =const CustomElement =prototype: ObjectCustomElementprototype {var h1 = documenth1innerText = 'hello world'this}// Note: it's important that you assign the styles// *before* the element is registered.document
Alternatively, using brfs and custom-element:
const styles =const customElement =const fs =const css = fsconst CustomElement =document
See Also
License
MIT. See LICENSE.md for details.