refactor: 界面重构美化

This commit is contained in:
Ray.Hao
2026-05-11 11:54:22 +08:00
parent 66615279eb
commit fe0775fbdb
31 changed files with 2836 additions and 2172 deletions

View File

@@ -59,7 +59,7 @@ export function generateThemeColors(primary: string, theme: ThemeMode) {
primary,
};
// 生成色变体
// 生成 primary 浅色/深色变体
for (let i = 1; i <= 9; i++) {
colors[`primary-light-${i}`] =
resolvedTheme === ThemeMode.LIGHT
@@ -67,12 +67,33 @@ export function generateThemeColors(primary: string, theme: ThemeMode) {
: `${getDarkColor(primary, i / 10)}`;
}
// 生成深色变体
colors["primary-dark-2"] =
resolvedTheme === ThemeMode.LIGHT
? `${getLightColor(primary, 0.2)}`
: `${getDarkColor(primary, 0.3)}`;
// 语义色success / warning / danger / info
const semanticColors: Record<string, string> = {
success: "#22c55e",
warning: "#faad14",
danger: "#ff4d4f",
info: "#788896",
};
Object.entries(semanticColors).forEach(([name, base]) => {
colors[name] = base;
for (let i = 1; i <= 9; i++) {
colors[`${name}-light-${i}`] =
resolvedTheme === ThemeMode.LIGHT
? `${getLightColor(base, i / 10)}`
: `${getDarkColor(base, i / 10)}`;
}
colors[`${name}-dark-2`] =
resolvedTheme === ThemeMode.LIGHT
? `${getLightColor(base, 0.2)}`
: `${getDarkColor(base, 0.3)}`;
});
return colors;
}