themeConfig.ts
2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import type { ThemeConfig } from 'antd';
import { PALETTE } from '@/features/heatmap/map/palette';
/**
* antd 主题。
*
* 主色 #4653A2 取自深城交官网主样式表;背景 / 边框 / 文字阶也一一对应官网页面的取色,
* 这样 antd 组件与自绘部分(面板卡片、地图图例)用的是同一套色,不会出现两种蓝。
*/
export const themeConfig: ThemeConfig = {
cssVar: {},
token: {
colorPrimary: PALETTE.primary,
colorLink: PALETTE.primary,
colorLinkHover: PALETTE.primaryHover,
colorSuccess: '#16A34A',
colorWarning: PALETTE.warn,
colorError: PALETTE.error,
colorInfo: PALETTE.primary,
colorBgLayout: PALETTE.bg,
colorBgContainer: PALETTE.surface,
colorBorder: PALETTE.border,
colorBorderSecondary: PALETTE.divider,
colorText: PALETTE.text1,
colorTextHeading: PALETTE.text1,
colorTextDescription: PALETTE.text2,
colorTextSecondary: PALETTE.text2,
colorTextTertiary: PALETTE.text3,
borderRadius: 8,
borderRadiusLG: 12,
controlHeight: 32,
fontSize: 13,
fontFamily:
"'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif",
boxShadowSecondary: '0 12px 40px -12px rgba(16,24,40,.2)',
wireframe: false,
},
components: {
Layout: {
headerBg: PALETTE.surface,
headerHeight: 60,
headerPadding: '0 18px',
bodyBg: PALETTE.bg,
},
Button: {
controlHeight: 32,
borderRadius: 8,
primaryShadow: '0 6px 16px -6px rgba(70,83,162,.45)',
},
Card: { borderRadiusLG: 14 },
Slider: { railBg: PALETTE.divider, railHoverBg: PALETTE.primarySoft, trackBg: PALETTE.primary },
Segmented: { itemSelectedBg: PALETTE.primary, itemSelectedColor: '#fff' },
Table: { headerBg: PALETTE.surfaceSunken ?? '#FAFBFD', headerColor: PALETTE.text2, rowHoverBg: 'rgba(70,83,162,.05)' },
Drawer: { paddingLG: 16 },
Select: { optionSelectedBg: 'rgba(70,83,162,.1)' },
Tag: { defaultBg: 'rgba(70,83,162,.08)', defaultColor: PALETTE.primary },
},
};