mirror of
https://github.com/vbenjs/vben-admin-thin-next.git
synced 2025-01-25 02:58:40 +08:00
20 lines
506 B
TypeScript
20 lines
506 B
TypeScript
/**
|
|
* Vite plugin for website theme color switching
|
|
* https://github.com/anncwb/vite-plugin-theme
|
|
*/
|
|
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;
|
|
}
|