Fixes webcomponent sample for local development

This commit is contained in:
Henning Dieterichs 2023-03-31 12:29:44 +02:00
parent f3cac1faff
commit 4886e1da08
No known key found for this signature in database
GPG key ID: 771381EFFDB9EC06

View file

@ -11,10 +11,12 @@ customElements.define(
const shadowRoot = this.attachShadow({ mode: "open" }); const shadowRoot = this.attachShadow({ mode: "open" });
// Copy over editor styles // Copy over editor styles
const style = document.querySelector( const styles = document.querySelectorAll(
"link[rel='stylesheet'][data-name='vs/editor/editor.main']" "link[rel='stylesheet'][data-name^='vs/']"
); );
for (const style of styles) {
shadowRoot.appendChild(style.cloneNode(true)); shadowRoot.appendChild(style.cloneNode(true));
}
const template = /** @type HTMLTemplateElement */ ( const template = /** @type HTMLTemplateElement */ (
document.getElementById("editor-template") document.getElementById("editor-template")