@paperbits/core
Version:
Paperbits core components.
15 lines (13 loc) • 446 B
text/typescript
class ShadowContainer extends HTMLElement {
constructor() {
super();
setTimeout(() => {
const nodes = Array.prototype.slice.call(this.childNodes);
const shadowRoot = this.attachShadow({ mode: "open" });
nodes.forEach(node => {
shadowRoot.appendChild(node);
}, 1000);
});
}
}
customElements.define("shadow-container", ShadowContainer);