chore: 统一代码风格并配置ESLint和Prettier
配置ESLint和Prettier规则 添加前端和后端的忽略文件 统一代码格式和缩进 修复代码风格问题
This commit is contained in:
@@ -18,7 +18,7 @@ export const useDesignTokens = () => {
|
||||
primary: {
|
||||
main: primaryColor,
|
||||
gradient: `linear-gradient(135deg, ${primaryColor} 0%, ${secondaryColor} 100%)`,
|
||||
light: '#8b9ff0'
|
||||
light: '#8b9ff0',
|
||||
},
|
||||
success: { main: '#10b981' },
|
||||
warning: { main: '#f59e0b' },
|
||||
@@ -26,15 +26,15 @@ export const useDesignTokens = () => {
|
||||
text: {
|
||||
primary: '#1e293b',
|
||||
secondary: '#64748b',
|
||||
inverse: '#ffffff'
|
||||
inverse: '#ffffff',
|
||||
},
|
||||
background: {
|
||||
primary: '#ffffff',
|
||||
secondary: '#f8fafc',
|
||||
dark: '#1e293b'
|
||||
dark: '#1e293b',
|
||||
},
|
||||
border: {
|
||||
light: '#e2e8f0'
|
||||
light: '#e2e8f0',
|
||||
},
|
||||
sidebar: {
|
||||
bg: '#ffffff',
|
||||
@@ -43,23 +43,23 @@ export const useDesignTokens = () => {
|
||||
text: '#475569',
|
||||
textHover: primaryColor,
|
||||
textActive: primaryColor,
|
||||
border: '#e2e8f0'
|
||||
}
|
||||
border: '#e2e8f0',
|
||||
},
|
||||
},
|
||||
shadows: {
|
||||
small: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
||||
medium: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)',
|
||||
large: '0 10px 15px -3px rgba(0, 0, 0, 0.1)'
|
||||
large: '0 10px 15px -3px rgba(0, 0, 0, 0.1)',
|
||||
},
|
||||
borderRadius: {
|
||||
small: '6px',
|
||||
medium: '10px'
|
||||
medium: '10px',
|
||||
},
|
||||
spacing: {
|
||||
sm: '8px',
|
||||
md: '16px',
|
||||
lg: '24px'
|
||||
}
|
||||
lg: '24px',
|
||||
},
|
||||
};
|
||||
}, [config?.primary_color, config?.secondary_color]);
|
||||
|
||||
@@ -74,16 +74,20 @@ export const useDesignTokens = () => {
|
||||
function hexToRgb(hex) {
|
||||
// 移除 # 号
|
||||
const cleanHex = hex.replace('#', '');
|
||||
|
||||
|
||||
// 处理简写格式 (如: #fff)
|
||||
const fullHex = cleanHex.length === 3
|
||||
? cleanHex.split('').map(c => c + c).join('')
|
||||
: cleanHex;
|
||||
|
||||
const fullHex =
|
||||
cleanHex.length === 3
|
||||
? cleanHex
|
||||
.split('')
|
||||
.map(c => c + c)
|
||||
.join('')
|
||||
: cleanHex;
|
||||
|
||||
const r = parseInt(fullHex.substring(0, 2), 16);
|
||||
const g = parseInt(fullHex.substring(2, 4), 16);
|
||||
const b = parseInt(fullHex.substring(4, 6), 16);
|
||||
|
||||
|
||||
return `${r}, ${g}, ${b}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user