style(projects): update prettier config

This commit is contained in:
Soybean
2022-04-01 14:47:57 +08:00
parent ca2dfa6185
commit df56abe18d
128 changed files with 2237 additions and 2037 deletions

View File

@ -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
};
}

View File

@ -18,7 +18,7 @@ export const useThemeStore = defineStore('theme-store', {
/** naive-ui暗黑主题 */
naiveTheme(state) {
return state.darkMode ? darkTheme : undefined;
},
}
},
actions: {
/** 重置theme状态 */
@ -128,6 +128,6 @@ export const useThemeStore = defineStore('theme-store', {
/** 设置页面过渡动画类型 */
setPageAnimateMode(mode: EnumType.ThemeAnimateMode) {
this.page.animateMode = mode;
},
},
}
}
});