feat: theme color switch

This commit is contained in:
vben
2021-02-03 23:52:55 +08:00
parent 85729f0f40
commit 3d1681ee9a
27 changed files with 469 additions and 253 deletions

View File

@@ -0,0 +1,15 @@
import { viteThemePlugin, mixLighten, mixDarken, tinycolor } from 'vite-plugin-theme';
import { getThemeColors, generateColors } from '../../config/themeConfig';
export function configThemePlugin() {
const colors = generateColors({
mixDarken,
mixLighten,
tinycolor,
});
const plugin = viteThemePlugin({
colorVariables: [...getThemeColors(), ...colors],
});
return plugin;
}