mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-10-14 05:43:41 +08:00
style(projects): update prettier config
This commit is contained in:
@@ -26,17 +26,17 @@ interface ColorAction {
|
||||
/** 获取主题颜色的各种场景对应的颜色 */
|
||||
function getThemeColors(colors: [ColorType, string][]) {
|
||||
const colorActions: ColorAction[] = [
|
||||
{ scene: '', handler: (color) => color },
|
||||
{ scene: 'Suppl', handler: (color) => color },
|
||||
{ scene: 'Hover', handler: (color) => getColorPalette(color, 5) },
|
||||
{ scene: 'Pressed', handler: (color) => getColorPalette(color, 7) },
|
||||
{ scene: 'Active', handler: (color) => addColorAlpha(color, 0.1) },
|
||||
{ scene: '', handler: color => color },
|
||||
{ scene: 'Suppl', handler: color => color },
|
||||
{ scene: 'Hover', handler: color => getColorPalette(color, 5) },
|
||||
{ scene: 'Pressed', handler: color => getColorPalette(color, 7) },
|
||||
{ scene: 'Active', handler: color => addColorAlpha(color, 0.1) }
|
||||
];
|
||||
|
||||
const themeColor: ThemeColor = {};
|
||||
|
||||
colors.forEach((color) => {
|
||||
colorActions.forEach((action) => {
|
||||
colors.forEach(color => {
|
||||
colorActions.forEach(action => {
|
||||
const [colorType, colorValue] = color;
|
||||
const colorKey: ColorKey = `${colorType}Color${action.scene}`;
|
||||
themeColor[colorKey] = action.handler(colorValue);
|
||||
@@ -57,18 +57,18 @@ export function getNaiveThemeOverrides(colors: Record<ColorType, string>): Globa
|
||||
['info', info],
|
||||
['success', success],
|
||||
['warning', warning],
|
||||
['error', error],
|
||||
['error', error]
|
||||
]);
|
||||
|
||||
const colorLoading = primary;
|
||||
|
||||
return {
|
||||
common: {
|
||||
...themeColors,
|
||||
...themeColors
|
||||
},
|
||||
LoadingBar: {
|
||||
colorLoading,
|
||||
},
|
||||
colorLoading
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ type ThemeVarsKeys = keyof ThemeVars;
|
||||
export function addThemeCssVarsToHtml(themeVars: ThemeVars) {
|
||||
const keys = Object.keys(themeVars) as ThemeVarsKeys[];
|
||||
const style: string[] = [];
|
||||
keys.forEach((key) => {
|
||||
keys.forEach(key => {
|
||||
style.push(`--${kebabCase(key)}: ${themeVars[key]}`);
|
||||
});
|
||||
const styleStr = style.join(';');
|
||||
@@ -97,6 +97,6 @@ export function handleWindicssDarkMode() {
|
||||
}
|
||||
return {
|
||||
addDarkClass,
|
||||
removeDarkClass,
|
||||
removeDarkClass
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user