From 005bd2e8ae17fdc35c766f38a23c5bff9aed960e Mon Sep 17 00:00:00 2001 From: Ayo Date: Fri, 8 May 2026 14:37:43 +0200 Subject: [PATCH] feat: update error message on using styles outside shadow roots --- src/WebComponent.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/WebComponent.js b/src/WebComponent.js index 95075e2..b46a1f0 100644 --- a/src/WebComponent.js +++ b/src/WebComponent.js @@ -208,14 +208,13 @@ export class WebComponent extends HTMLElement { try { const styleObj = new CSSStyleSheet() styleObj.replaceSync(this.constructor.styles) - console.log(this.constructor.styles, this.constructor.props) this.#host.adoptedStyleSheets = [ ...this.#host.adoptedStyleSheets, styleObj, ] } catch (e) { console.error( - 'ERR: Constructable stylesheets are only supported in shadow roots', + 'ERR: Constructable stylesheets are only supported in shadow roots. Use `static shadowRootInit` https://webcomponent.io/shadow-dom/', e ) }