You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
494 B
17 lines
494 B
import { getThemeColors, generateColors } from '../../../build/config/themeConfig';
|
|
|
|
import { replaceStyleVariables } from 'vite-plugin-theme/es/client';
|
|
import { mixLighten, mixDarken, tinycolor } from 'vite-plugin-theme/es/colorUtils';
|
|
|
|
export async function changeTheme(color: string) {
|
|
const colors = generateColors({
|
|
mixDarken,
|
|
mixLighten,
|
|
tinycolor,
|
|
color,
|
|
});
|
|
|
|
return await replaceStyleVariables({
|
|
colorVariables: [...getThemeColors(color), ...colors],
|
|
});
|
|
}
|
|
|