File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 11import type { GlobalThemeOverrides } from 'naive-ui' ;
22import { getColorByColorPaletteNumber , getColorPalette } from '@sa/color-palette' ;
33import { addColorAlpha , getRgbOfColor } from '@sa/utils' ;
4- import { useStyleTag } from '@vueuse/core' ;
54import { overrideThemeSettings , themeSettings } from '@/theme/settings' ;
65import { themeVars } from '@/theme/vars' ;
76import { localStg } from '@/utils/storage' ;
@@ -130,7 +129,6 @@ function getCssVarByTokens(tokens: App.Theme.BaseToken) {
130129 return styleStr ;
131130}
132131
133- const { css : themeVarCss } = useStyleTag ( '' , { id : 'theme-var-css' } ) ;
134132/**
135133 * Add theme vars to html
136134 *
@@ -152,7 +150,15 @@ export function addThemeVarsToHtml(tokens: App.Theme.BaseToken, darkTokens: App.
152150 }
153151 ` ;
154152
155- themeVarCss . value = css + darkCss ;
153+ const styleId = 'theme-vars' ;
154+
155+ const style = document . querySelector ( `#${ styleId } ` ) || document . createElement ( 'style' ) ;
156+
157+ style . id = styleId ;
158+
159+ style . textContent = css + darkCss ;
160+
161+ document . head . appendChild ( style ) ;
156162}
157163
158164/**
You can’t perform that action at this time.
0 commit comments