From 4886e1da087e36c3c8211208e8000199762e5749 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Fri, 31 Mar 2023 12:29:44 +0200 Subject: [PATCH] Fixes webcomponent sample for local development --- .../creating-the-editor/web-component/sample.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.js b/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.js index 07dc477f..9f178b30 100644 --- a/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.js +++ b/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.js @@ -11,10 +11,12 @@ customElements.define( const shadowRoot = this.attachShadow({ mode: "open" }); // Copy over editor styles - const style = document.querySelector( - "link[rel='stylesheet'][data-name='vs/editor/editor.main']" + const styles = document.querySelectorAll( + "link[rel='stylesheet'][data-name^='vs/']" ); - shadowRoot.appendChild(style.cloneNode(true)); + for (const style of styles) { + shadowRoot.appendChild(style.cloneNode(true)); + } const template = /** @type HTMLTemplateElement */ ( document.getElementById("editor-template")