UNPKG

@chasemoskal/magical

Version:

web toolkit for lit apps

11 lines (8 loc) 346 B
import {CSSResultGroup} from "lit" import {attachStylesToShadowRoot} from "./attach-styles-to-shadow-root.js" export function createShadowDomWithStyles(css?: CSSResultGroup) { const element = document.createElement("span") const shadow = element.attachShadow({mode: "open"}) attachStylesToShadowRoot(shadow, css) return {element, shadow} }