File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ const _createStyle = (tagName, styleContent) => {
24
24
}
25
25
26
26
let style ;
27
- if ( window . CSSStyleSheet ) {
27
+ if ( document . adoptedStyleSheets ) {
28
28
style = createConstructableStyleSheet ( styleContent ) ;
29
29
} else {
30
30
style = createStyleElement ( styleContent ) ;
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ class WebComponent extends HTMLElement {
65
65
return ;
66
66
}
67
67
const newStyle = createStyle ( this . constructor ) ;
68
- if ( window . CSSStyleSheet ) {
68
+ if ( document . adoptedStyleSheets ) {
69
69
this . shadowRoot . adoptedStyleSheets = [ newStyle ] ;
70
70
} else {
71
71
const oldStyle = this . shadowRoot . querySelector ( "style" ) ;
@@ -86,7 +86,7 @@ class WebComponent extends HTMLElement {
86
86
const shadowDOM = await ShadowDOM . prepareShadowDOM ( this . constructor ) ;
87
87
this . shadowRoot . appendChild ( shadowDOM ) ;
88
88
89
- if ( window . CSSStyleSheet ) {
89
+ if ( document . adoptedStyleSheets ) {
90
90
const style = createStyle ( this . constructor ) ;
91
91
this . shadowRoot . adoptedStyleSheets = [ style ] ;
92
92
}
You can’t perform that action at this time.
0 commit comments