项目初始化
This commit is contained in:
17
web-vue/packages/core/logics/theme/index.ts
Normal file
17
web-vue/packages/core/logics/theme/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { getThemeColors, generateColors } from '@jeesite/vite/theme/themeConfig';
|
||||
|
||||
import { replaceStyleVariables } from 'vite-plugin-theme-vite3/es/client';
|
||||
import { mixLighten, mixDarken, tinycolor } from 'vite-plugin-theme-vite3/es/colorUtils';
|
||||
|
||||
export async function changeTheme(color: string) {
|
||||
const colors = generateColors({
|
||||
mixDarken,
|
||||
mixLighten,
|
||||
tinycolor,
|
||||
color,
|
||||
});
|
||||
|
||||
return await replaceStyleVariables({
|
||||
colorVariables: [...getThemeColors(color), ...colors],
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user