Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | 35x 35x 35x 35x 35x 35x | // 字体族
export const fontFamily = {
sans: 'System',
serif: 'Georgia',
mono: 'Menlo',
brand: 'MaoKen', // 品牌字体
} as const;
// 字重
export const fontWeight = {
thin: '100' as const,
extralight: '200' as const,
light: '300' as const,
normal: '400' as const,
medium: '500' as const,
semibold: '600' as const,
bold: '700' as const,
extrabold: '800' as const,
black: '900' as const,
};
// 字号 (px)
export const fontSize = {
1: 10,
2: 11,
3: 12,
4: 13,
5: 14,
6: 15,
7: 16,
8: 18,
9: 20,
10: 24,
11: 28,
12: 32,
13: 40,
14: 48,
15: 64,
} as const;
// 行高比例
export const lineHeight = {
none: 1,
tight: 1.25,
snug: 1.375,
normal: 1.5,
relaxed: 1.625,
loose: 2,
} as const;
// 字间距 (px)
export const letterSpacing = {
tighter: -0.8,
tight: -0.4,
normal: 0,
wide: 0.4,
wider: 0.8,
widest: 1.6,
} as const;
// 预设文本样式
export const textStyles = {
display: {
fontSize: fontSize[13],
fontWeight: fontWeight.bold,
lineHeight: lineHeight.tight,
letterSpacing: letterSpacing.tight,
},
h1: {
fontSize: fontSize[11],
fontWeight: fontWeight.bold,
lineHeight: lineHeight.tight,
letterSpacing: letterSpacing.tight,
},
h2: {
fontSize: fontSize[10],
fontWeight: fontWeight.semibold,
lineHeight: lineHeight.snug,
letterSpacing: letterSpacing.normal,
},
h3: {
fontSize: fontSize[9],
fontWeight: fontWeight.semibold,
lineHeight: lineHeight.snug,
letterSpacing: letterSpacing.normal,
},
h4: {
fontSize: fontSize[8],
fontWeight: fontWeight.medium,
lineHeight: lineHeight.normal,
letterSpacing: letterSpacing.normal,
},
bodyLg: {
fontSize: fontSize[7],
fontWeight: fontWeight.normal,
lineHeight: lineHeight.relaxed,
letterSpacing: letterSpacing.normal,
},
body: {
fontSize: fontSize[6],
fontWeight: fontWeight.normal,
lineHeight: lineHeight.relaxed,
letterSpacing: letterSpacing.normal,
},
bodySm: {
fontSize: fontSize[5],
fontWeight: fontWeight.normal,
lineHeight: lineHeight.normal,
letterSpacing: letterSpacing.normal,
},
caption: {
fontSize: fontSize[4],
fontWeight: fontWeight.normal,
lineHeight: lineHeight.normal,
letterSpacing: letterSpacing.normal,
},
captionSm: {
fontSize: fontSize[3],
fontWeight: fontWeight.normal,
lineHeight: lineHeight.normal,
letterSpacing: letterSpacing.wide,
},
label: {
fontSize: fontSize[4],
fontWeight: fontWeight.medium,
lineHeight: lineHeight.tight,
letterSpacing: letterSpacing.wide,
},
button: {
fontSize: fontSize[6],
fontWeight: fontWeight.semibold,
lineHeight: lineHeight.tight,
letterSpacing: letterSpacing.normal,
},
code: {
fontSize: fontSize[5],
fontWeight: fontWeight.normal,
lineHeight: lineHeight.normal,
letterSpacing: letterSpacing.normal,
},
} as const;
export type FontFamily = typeof fontFamily;
export type FontWeight = typeof fontWeight;
export type FontSize = typeof fontSize;
export type TextStyle = keyof typeof textStyles;
|