Skip to content

Commit

Permalink
fix(projects): fix css var is inserted repeatedly
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Apr 13, 2024
1 parent 423ea0d commit e58cf26
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/store/modules/theme/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ export function addThemeVarsToHtml(tokens: App.Theme.BaseToken, darkTokens: App.
}
`;

const style = document.createElement('style');
const styleId = 'theme-vars';

const style = document.querySelector(`#${styleId}`) || document.createElement('style');

style.id = styleId;

style.textContent = css + darkCss;

Expand Down

0 comments on commit e58cf26

Please sign in to comment.