主题切换

This commit is contained in:
sjl
2025-03-19 10:26:41 +08:00
parent c215f51554
commit 962c286fd5
10 changed files with 86 additions and 17 deletions

View File

@@ -41,8 +41,12 @@ export const useTheme = () => {
for (let i = 1; i <= 9; i++) {
const primaryColor = isDark.value ? `${getDarkColor(val, i / 10)}` : `${getLightColor(val, i / 10)}`;
document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, primaryColor);
// const colorValue = document.documentElement.style.getPropertyValue(`--el-color-primary-light-${i}`).trim();
// console.log(`--el-color-primary-light-${i}: ${colorValue}`);
}
globalStore.setGlobalState("primary", val);
}
// 灰色和弱色切换
const changeGreyOrWeak = (type: Theme.GreyOrWeakType, value: boolean) => {