feat: update error message on using styles outside shadow roots
This commit is contained in:
parent
64a2a3fc87
commit
005bd2e8ae
1 changed files with 1 additions and 2 deletions
|
|
@ -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
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue