Created
June 4, 2023 21:11
-
-
Save FrankDeGroot/e894f320e45d99c9578aa72283aeed39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (const template of document.getElementsByTagName("template")) { | |
customElements.define( | |
template.id, | |
class extends HTMLElement { | |
constructor() { | |
super(); | |
this.attachShadow({ | |
mode: "open" | |
}).appendChild(template.content.cloneNode(true)); | |
} | |
} | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment