Skip to content

Commit

Permalink
refactor: optimize document api usage
Browse files Browse the repository at this point in the history
  • Loading branch information
fengtianze committed Jan 18, 2024
1 parent b4a96de commit 5e9e922
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/utils/styles-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ export class CSSStyleSheetRenderer implements Renderer {
render(styles: string): void {
if (!this.styleSheet) {
this.styleSheet = new CSSStyleSheet(this.options);
document.adoptedStyleSheets = [
...document.adoptedStyleSheets,
this.styleSheet,
];
document.adoptedStyleSheets.push(this.styleSheet);
}
this.styleSheet.replaceSync(styles);
}
Expand Down

0 comments on commit 5e9e922

Please sign in to comment.