File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -66,10 +66,17 @@ class AtroposComponent extends HTMLElement {
66
66
` ;
67
67
this . shadow . innerHTML = '' ;
68
68
69
- // eslint-disable-next-line no-restricted-globals
70
- const styleSheet = new CSSStyleSheet ( ) ;
71
- styleSheet . replaceSync ( styles ) ;
72
- this . shadow . adoptedStyleSheets = [ styleSheet ] ;
69
+ if ( typeof CSSStyleSheet !== 'undefined' && this . shadow . adoptedStyleSheets ) {
70
+ // eslint-disable-next-line no-restricted-globals
71
+ const styleSheet = new CSSStyleSheet ( ) ;
72
+ styleSheet . replaceSync ( styles ) ;
73
+ this . shadow . adoptedStyleSheets = [ styleSheet ] ;
74
+ } else {
75
+ const styleEl = document . createElement ( 'style' ) ;
76
+ styleEl . rel = 'stylesheet' ;
77
+ styleEl . textContent = styles ;
78
+ this . shadow . appendChild ( styleEl ) ;
79
+ }
73
80
74
81
this . shadow . appendChild ( el ) ;
75
82
You can’t perform that action at this time.
0 commit comments