feat(projects): 添加缓存主题色

This commit is contained in:
Soybean
2022-01-22 00:48:17 +08:00
parent 1d63a83822
commit 37092974d3
15 changed files with 87 additions and 34 deletions

View File

@ -34,8 +34,8 @@ function initSvgLogo(id) {
function addThemeColorCssVars() {
const key = '__THEME_COLOR__';
const themeColor = '#1890ff';
const cssVars = window.localStorage.getItem(key) || `--primary-color: ${themeColor}`;
const themeColor = window.localStorage.getItem(key) || '#1890ff';
const cssVars = `--primary-color: ${themeColor}`;
document.documentElement.style.cssText = cssVars;
}