Skip to content

Commit

Permalink
replace all stylesheets and support older chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank99 committed Mar 26, 2024
1 parent ddf15f4 commit c806c11
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function useShadowRoot(
// create an empty stylesheet and add it to the shadowRoot
const _global = shadow.ownerDocument.defaultView || globalThis;
styleSheet.current = new _global.CSSStyleSheet();
shadow.adoptedStyleSheets.push(styleSheet.current);
shadow.adoptedStyleSheets = [styleSheet.current];

// add the CSS immediately to avoid FOUC (one-time)
if (latestCss.current) {
Expand Down

0 comments on commit c806c11

Please sign in to comment.