typography.scss
2.85 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
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
// 字体系统
$font-family-primary: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
// 文字层级系统
.text-h1 {
font-family: $font-family-primary;
font-size: 24px;
font-weight: 600;
line-height: 40px;
letter-spacing: 0;
color: var(--el-text-color-primary);
}
.text-h2 {
font-family: $font-family-primary;
font-size: 20px;
font-weight: 600;
line-height: 32px;
letter-spacing: 0;
color: var(--el-text-color-primary);
}
.text-h3 {
font-family: $font-family-primary;
font-size: 18px;
font-weight: 600;
line-height: 28px;
letter-spacing: 0;
color: var(--el-text-color-primary);
}
.text-h4 {
font-family: $font-family-primary;
font-size: 16px;
font-weight: 600;
line-height: 24px;
letter-spacing: 0;
color: var(--el-text-color-primary);
}
.text-body {
font-family: $font-family-primary;
font-size: 14px;
font-weight: 400;
line-height: 22px;
letter-spacing: 0;
color: var(--el-text-color-primary);
}
.text-caption {
font-family: $font-family-primary;
font-size: 12px;
font-weight: 400;
line-height: 18px;
letter-spacing: 0;
color: var(--el-text-color-regular);
}
.text-small {
font-family: $font-family-primary;
font-size: 11px;
font-weight: 400;
line-height: 16px;
letter-spacing: 0;
color: var(--el-text-color-secondary);
}
// 文字工具类
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-bold { font-weight: 600; }
.text-medium { font-weight: 500; }
.text-normal { font-weight: 400; }
.text-ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.text-ellipsis-2 {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.text-ellipsis-3 {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
// 全局文字样式重置
* {
font-family: $font-family-primary;
}
// 标题样式
h1, .h1 {
@extend .text-h1;
}
h2, .h2 {
@extend .text-h2;
}
h3, .h3 {
@extend .text-h3;
}
h4, .h4 {
@extend .text-h4;
}
// 段落和文本样式
p, .p {
@extend .text-body;
margin: 0 0 16px 0;
}
// 小文本样式
small, .small {
@extend .text-caption;
}
// 标签样式
label, .label {
@extend .text-caption;
font-weight: 500;
display: block;
margin-bottom: 6px;
}
// 按钮文字样式
button, .btn {
font-family: $font-family-primary;
font-weight: 500;
letter-spacing: 0;
}
// 输入框文字样式
input, textarea, select {
font-family: $font-family-primary;
font-size: 14px;
line-height: 22px;
letter-spacing: 0;
}
// 表格文字样式
table {
font-family: $font-family-primary;
th {
font-weight: 500;
font-size: 12px;
line-height: 18px;
letter-spacing: 0;
}
td {
font-size: 12px;
line-height: 18px;
letter-spacing: 0;
}
}