refactor(theme): 移除未使用的主题CSS变量函数并更新文本样式

移除theme.store.ts中未使用的getThemeCSSVariables函数,该函数已被其他实现替代
在mine/index.vue中使用theme-text-secondary类统一文本颜色样式
This commit is contained in:
zhangtao
2025-09-26 00:07:58 +08:00
parent 8f5316df91
commit 3138fde133
2 changed files with 9 additions and 26 deletions
-17
View File
@@ -110,18 +110,6 @@ export const useThemeStore = defineStore("appTheme", () => {
Object.assign(themeVars, colors);
};
// 获取主题CSS变量配置
const getThemeCSSVariables = (isDark: boolean) => ({
'--wot-color-bg': isDark ? '#0f0f0f' : '#f8f8f8',
'--wot-color-title': isDark ? '#ffffff' : '#1d2129',
'--wot-color-content': isDark ? '#e0e0e0' : '#4e5969',
'--wot-color-secondary': isDark ? '#a0a0a0' : '#86909c',
'--wot-color-border': isDark ? '#2f2f2f' : '#e5e6eb',
'--wot-color-border-light': isDark ? '#3d3d3d' : '#f2f3f5',
'--wot-card-bg': isDark ? '#1a1a1a' : '#ffffff',
'--wot-card-content-border-color': isDark ? '#2f2f2f' : '#e5e6eb',
});
// 更新CSS变量
const updateCSSVariables = () => {
// 确保在客户端环境且DOM已准备好
@@ -136,11 +124,6 @@ export const useThemeStore = defineStore("appTheme", () => {
root.classList.toggle('dark', isDark);
root.classList.toggle('light', !isDark);
// 批量设置CSS变量
const cssVars = getThemeCSSVariables(isDark);
Object.entries(cssVars).forEach(([key, value]) => {
root.style.setProperty(key, value);
});
}
// 更新主题变量