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 {
|
try {
|
||||||
const styleObj = new CSSStyleSheet()
|
const styleObj = new CSSStyleSheet()
|
||||||
styleObj.replaceSync(this.constructor.styles)
|
styleObj.replaceSync(this.constructor.styles)
|
||||||
console.log(this.constructor.styles, this.constructor.props)
|
|
||||||
this.#host.adoptedStyleSheets = [
|
this.#host.adoptedStyleSheets = [
|
||||||
...this.#host.adoptedStyleSheets,
|
...this.#host.adoptedStyleSheets,
|
||||||
styleObj,
|
styleObj,
|
||||||
]
|
]
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(
|
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
|
e
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue