@alegendstale/holly-components
Version:
Reusable UI components created using lit
16 lines (15 loc) • 548 B
JavaScript
let d = /* @__PURE__ */ new WeakMap();
function n(l, e = globalThis.document) {
e = e.ownerDocument ?? e;
let a = e.defaultView;
if (e.adoptedStyleSheets) {
let t = new a.CSSStyleSheet();
return t.replaceSync(l), Object.isFrozen(e.adoptedStyleSheets) ? e.adoptedStyleSheets = [...e.adoptedStyleSheets, t] : e.adoptedStyleSheets.push(t), t;
} else {
let t = d.get(e);
return t || (t = e.head.appendChild(e.createElement("style")), d.set(e, t)), t.insertAdjacentText("beforeend", l), t.sheet;
}
}
export {
n as default
};