@cyberpunk-vue/theme-chalk 1.14.0 → 1.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/package.json +1 -1
- package/src/common/var.scss +247 -247
- package/src/components/avatar-group.scss +113 -113
- package/src/components/avatar.scss +123 -123
- package/src/components/badge.scss +210 -210
- package/src/components/breadcrumb.scss +203 -203
- package/src/components/button.scss +975 -975
- package/src/components/card.scss +699 -696
- package/src/components/checkbox-group.scss +22 -22
- package/src/components/checkbox.scss +320 -320
- package/src/components/col.scss +43 -43
- package/src/components/dialog.scss +360 -360
- package/src/components/divider.scss +250 -250
- package/src/components/empty.scss +99 -99
- package/src/components/form-item.scss +189 -189
- package/src/components/form.scss +59 -59
- package/src/components/icon.scss +83 -83
- package/src/components/image-preview.scss +147 -147
- package/src/components/image.scss +351 -351
- package/src/components/input-number.scss +129 -129
- package/src/components/input.scss +362 -362
- package/src/components/loading.scss +64 -64
- package/src/components/notification.scss +348 -348
- package/src/components/pagination.scss +287 -280
- package/src/components/pattern-background.scss +18 -18
- package/src/components/popover.scss +438 -438
- package/src/components/progress.scss +438 -438
- package/src/components/radio-group.scss +22 -22
- package/src/components/radio.scss +286 -286
- package/src/components/row.scss +12 -12
- package/src/components/scrollbar.scss +40 -40
- package/src/components/segmented.scss +566 -566
- package/src/components/select.scss +15 -1
- package/src/components/slider.scss +421 -421
- package/src/components/status-indicator.scss +206 -206
- package/src/components/switch.scss +405 -405
- package/src/components/table.scss +474 -474
- package/src/components/tag.scss +416 -416
- package/src/components/text.scss +310 -271
- package/src/components/textarea.scss +106 -104
- package/src/components/timeline.scss +379 -379
- package/src/components/tree.scss +397 -397
- package/src/components/upload.scss +509 -509
- package/src/index.scss +60 -60
- package/src/mixins/mixins.scss +156 -156
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
// CpCheckboxGroup 组件样式
|
|
2
|
-
|
|
3
|
-
@use '../common/var' as *;
|
|
4
|
-
@use '../mixins/mixins' as *;
|
|
5
|
-
|
|
6
|
-
@include b(checkbox-group) {
|
|
7
|
-
display: inline-flex;
|
|
8
|
-
flex-wrap: wrap;
|
|
9
|
-
gap: 16px;
|
|
10
|
-
|
|
11
|
-
// 水平布局 (默认)
|
|
12
|
-
@include m(horizontal) {
|
|
13
|
-
flex-direction: row;
|
|
14
|
-
align-items: center;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// 垂直布局
|
|
18
|
-
@include m(vertical) {
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
align-items: flex-start;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
// CpCheckboxGroup 组件样式
|
|
2
|
+
|
|
3
|
+
@use '../common/var' as *;
|
|
4
|
+
@use '../mixins/mixins' as *;
|
|
5
|
+
|
|
6
|
+
@include b(checkbox-group) {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
flex-wrap: wrap;
|
|
9
|
+
gap: 16px;
|
|
10
|
+
|
|
11
|
+
// 水平布局 (默认)
|
|
12
|
+
@include m(horizontal) {
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
align-items: center;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// 垂直布局
|
|
18
|
+
@include m(vertical) {
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
align-items: flex-start;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,256 +1,256 @@
|
|
|
1
|
-
// CpCheckbox 组件样式
|
|
2
|
-
// 赛博朋克/机甲风格
|
|
3
|
-
|
|
4
|
-
@use 'sass:map';
|
|
5
|
-
@use '../common/var' as *;
|
|
6
|
-
@use '../mixins/mixins' as *;
|
|
7
|
-
|
|
8
|
-
// Checkbox 尺寸变量
|
|
9
|
-
$checkbox-sizes: (
|
|
10
|
-
sm: (
|
|
11
|
-
size: 14px,
|
|
12
|
-
font-size: 12px,
|
|
13
|
-
clip: 3px,
|
|
14
|
-
border-radius: 2px,
|
|
15
|
-
),
|
|
16
|
-
md: (
|
|
17
|
-
size: 18px,
|
|
18
|
-
font-size: 14px,
|
|
19
|
-
clip: 4px,
|
|
20
|
-
border-radius: 2px,
|
|
21
|
-
),
|
|
22
|
-
lg: (
|
|
23
|
-
size: 22px,
|
|
24
|
-
font-size: 16px,
|
|
25
|
-
clip: 5px,
|
|
26
|
-
border-radius: 3px,
|
|
27
|
-
),
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
@include b(checkbox) {
|
|
31
|
-
// 基础样式
|
|
32
|
-
position: relative;
|
|
33
|
-
display: inline-flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
gap: 8px;
|
|
36
|
-
cursor: pointer;
|
|
37
|
-
user-select: none;
|
|
38
|
-
vertical-align: middle;
|
|
39
|
-
font-family: var(--cp-font-family-ui);
|
|
40
|
-
color: var(--cp-text-secondary);
|
|
41
|
-
transition: color 0.2s ease;
|
|
42
|
-
|
|
43
|
-
// CSS 变量
|
|
44
|
-
--cp-checkbox-active-color: var(--cp-color-primary);
|
|
45
|
-
--cp-checkbox-active-color-light: var(--cp-color-primary-light);
|
|
46
|
-
--cp-checkbox-check-color: var(--cp-color-primary-text);
|
|
47
|
-
--cp-checkbox-size: 18px;
|
|
48
|
-
|
|
49
|
-
&:hover:not(.is-disabled) {
|
|
50
|
-
color: var(--cp-text-primary);
|
|
51
|
-
|
|
52
|
-
.cp-checkbox__indicator {
|
|
53
|
-
border-color: var(--cp-checkbox-active-color);
|
|
54
|
-
box-shadow: 0 0 6px var(--cp-checkbox-active-color-light);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// ===== 隐藏原生 input =====
|
|
59
|
-
@include e(input) {
|
|
60
|
-
position: absolute;
|
|
61
|
-
width: 0;
|
|
62
|
-
height: 0;
|
|
63
|
-
opacity: 0;
|
|
64
|
-
margin: 0;
|
|
65
|
-
pointer-events: none;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// ===== 指示器 =====
|
|
69
|
-
@include e(indicator) {
|
|
70
|
-
position: relative;
|
|
71
|
-
display: flex;
|
|
72
|
-
align-items: center;
|
|
73
|
-
justify-content: center;
|
|
74
|
-
width: var(--cp-checkbox-size);
|
|
75
|
-
height: var(--cp-checkbox-size);
|
|
76
|
-
background: var(--cp-surface-variant);
|
|
77
|
-
border: 1px solid var(--cp-border);
|
|
78
|
-
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
|
79
|
-
flex-shrink: 0;
|
|
80
|
-
|
|
81
|
-
// 机甲切角装饰(仅 clip 形状时显示,通过 shape 控制)
|
|
82
|
-
&::before {
|
|
83
|
-
content: '';
|
|
84
|
-
position: absolute;
|
|
85
|
-
top: -1px;
|
|
86
|
-
right: -1px;
|
|
87
|
-
width: 5px;
|
|
88
|
-
height: 5px;
|
|
89
|
-
background: transparent;
|
|
90
|
-
border-top: 1px solid var(--cp-border);
|
|
91
|
-
border-right: 1px solid var(--cp-border);
|
|
92
|
-
clip-path: polygon(0 0, 100% 0, 100% 100%);
|
|
93
|
-
transition: all 0.25s ease;
|
|
94
|
-
display: none; // 默认隐藏,shape-clip 时显示
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// ===== 图标 =====
|
|
99
|
-
@include e(icon) {
|
|
100
|
-
width: 70%;
|
|
101
|
-
height: 70%;
|
|
102
|
-
color: var(--cp-checkbox-check-color);
|
|
103
|
-
stroke: var(--cp-checkbox-check-color);
|
|
104
|
-
opacity: 0;
|
|
105
|
-
transform: scale(0.5);
|
|
106
|
-
transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
107
|
-
|
|
108
|
-
// 确保 SVG 子元素使用同一颜色(避免继承差异)
|
|
109
|
-
polyline,
|
|
110
|
-
line {
|
|
111
|
-
stroke: var(--cp-checkbox-check-color);
|
|
112
|
-
stroke-width: 3px;
|
|
113
|
-
stroke-linecap: square;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// ===== 标签 =====
|
|
118
|
-
@include e(label) {
|
|
119
|
-
font-weight: 500;
|
|
120
|
-
transition: color 0.2s ease;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// ===== 尺寸 =====
|
|
124
|
-
@each $size-name, $size-config in $checkbox-sizes {
|
|
125
|
-
@include m(#{$size-name}) {
|
|
126
|
-
$size: map.get($size-config, size);
|
|
127
|
-
|
|
128
|
-
--cp-checkbox-size: #{$size};
|
|
129
|
-
|
|
130
|
-
.cp-checkbox__label {
|
|
131
|
-
font-size: map.get($size-config, font-size);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
@include when(custom-size) {
|
|
137
|
-
// custom-size 无特殊 clip-path,由 shape modifier 控制
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// ===== 形状 =====
|
|
141
|
-
@include m(shape-clip) {
|
|
142
|
-
.cp-checkbox__indicator {
|
|
143
|
-
clip-path: polygon(
|
|
144
|
-
4px 0,
|
|
145
|
-
100% 0,
|
|
146
|
-
100% calc(100% - 4px),
|
|
147
|
-
calc(100% - 4px) 100%,
|
|
148
|
-
0 100%,
|
|
149
|
-
0 4px
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
&::before {
|
|
153
|
-
display: block;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
&.cp-checkbox--sm .cp-checkbox__indicator {
|
|
158
|
-
clip-path: polygon(
|
|
159
|
-
3px 0,
|
|
160
|
-
100% 0,
|
|
161
|
-
100% calc(100% - 3px),
|
|
162
|
-
calc(100% - 3px) 100%,
|
|
163
|
-
0 100%,
|
|
164
|
-
0 3px
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
&.cp-checkbox--lg .cp-checkbox__indicator {
|
|
169
|
-
clip-path: polygon(
|
|
170
|
-
5px 0,
|
|
171
|
-
100% 0,
|
|
172
|
-
100% calc(100% - 5px),
|
|
173
|
-
calc(100% - 5px) 100%,
|
|
174
|
-
0 100%,
|
|
175
|
-
0 5px
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
@include m(shape-no-clip) {
|
|
181
|
-
.cp-checkbox__indicator {
|
|
182
|
-
clip-path: none;
|
|
183
|
-
|
|
184
|
-
&::before {
|
|
185
|
-
display: none;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
@include m(shape-round) {
|
|
191
|
-
.cp-checkbox__indicator {
|
|
192
|
-
clip-path: none;
|
|
193
|
-
border-radius: 4px;
|
|
194
|
-
|
|
195
|
-
&::before {
|
|
196
|
-
display: none;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// ===== 选中状态 =====
|
|
202
|
-
@include when(checked) {
|
|
203
|
-
.cp-checkbox__indicator {
|
|
204
|
-
background: var(--cp-checkbox-active-color);
|
|
205
|
-
border-color: var(--cp-checkbox-active-color);
|
|
206
|
-
box-shadow: 0 0 10px var(--cp-checkbox-active-color-light);
|
|
207
|
-
|
|
208
|
-
&::before {
|
|
209
|
-
border-color: rgba(255, 255, 255, 0.6);
|
|
210
|
-
background: rgba(255, 255, 255, 0.3);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.cp-checkbox__icon {
|
|
215
|
-
opacity: 1;
|
|
216
|
-
transform: scale(1);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// ===== 半选状态 =====
|
|
221
|
-
@include when(indeterminate) {
|
|
222
|
-
.cp-checkbox__indicator {
|
|
223
|
-
background: var(--cp-checkbox-active-color);
|
|
224
|
-
border-color: var(--cp-checkbox-active-color);
|
|
225
|
-
box-shadow: 0 0 10px var(--cp-checkbox-active-color-light);
|
|
226
|
-
|
|
227
|
-
&::before {
|
|
228
|
-
border-color: rgba(255, 255, 255, 0.6);
|
|
229
|
-
background: rgba(255, 255, 255, 0.3);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.cp-checkbox__icon {
|
|
234
|
-
opacity: 1;
|
|
235
|
-
transform: scale(1);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
// ===== 边框模式 =====
|
|
1
|
+
// CpCheckbox 组件样式
|
|
2
|
+
// 赛博朋克/机甲风格
|
|
3
|
+
|
|
4
|
+
@use 'sass:map';
|
|
5
|
+
@use '../common/var' as *;
|
|
6
|
+
@use '../mixins/mixins' as *;
|
|
7
|
+
|
|
8
|
+
// Checkbox 尺寸变量
|
|
9
|
+
$checkbox-sizes: (
|
|
10
|
+
sm: (
|
|
11
|
+
size: 14px,
|
|
12
|
+
font-size: 12px,
|
|
13
|
+
clip: 3px,
|
|
14
|
+
border-radius: 2px,
|
|
15
|
+
),
|
|
16
|
+
md: (
|
|
17
|
+
size: 18px,
|
|
18
|
+
font-size: 14px,
|
|
19
|
+
clip: 4px,
|
|
20
|
+
border-radius: 2px,
|
|
21
|
+
),
|
|
22
|
+
lg: (
|
|
23
|
+
size: 22px,
|
|
24
|
+
font-size: 16px,
|
|
25
|
+
clip: 5px,
|
|
26
|
+
border-radius: 3px,
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
@include b(checkbox) {
|
|
31
|
+
// 基础样式
|
|
32
|
+
position: relative;
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: 8px;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
user-select: none;
|
|
38
|
+
vertical-align: middle;
|
|
39
|
+
font-family: var(--cp-font-family-ui);
|
|
40
|
+
color: var(--cp-text-secondary);
|
|
41
|
+
transition: color 0.2s ease;
|
|
42
|
+
|
|
43
|
+
// CSS 变量
|
|
44
|
+
--cp-checkbox-active-color: var(--cp-color-primary);
|
|
45
|
+
--cp-checkbox-active-color-light: var(--cp-color-primary-light);
|
|
46
|
+
--cp-checkbox-check-color: var(--cp-color-primary-text);
|
|
47
|
+
--cp-checkbox-size: 18px;
|
|
48
|
+
|
|
49
|
+
&:hover:not(.is-disabled) {
|
|
50
|
+
color: var(--cp-text-primary);
|
|
51
|
+
|
|
52
|
+
.cp-checkbox__indicator {
|
|
53
|
+
border-color: var(--cp-checkbox-active-color);
|
|
54
|
+
box-shadow: 0 0 6px var(--cp-checkbox-active-color-light);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// ===== 隐藏原生 input =====
|
|
59
|
+
@include e(input) {
|
|
60
|
+
position: absolute;
|
|
61
|
+
width: 0;
|
|
62
|
+
height: 0;
|
|
63
|
+
opacity: 0;
|
|
64
|
+
margin: 0;
|
|
65
|
+
pointer-events: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// ===== 指示器 =====
|
|
69
|
+
@include e(indicator) {
|
|
70
|
+
position: relative;
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
width: var(--cp-checkbox-size);
|
|
75
|
+
height: var(--cp-checkbox-size);
|
|
76
|
+
background: var(--cp-surface-variant);
|
|
77
|
+
border: 1px solid var(--cp-border);
|
|
78
|
+
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
|
79
|
+
flex-shrink: 0;
|
|
80
|
+
|
|
81
|
+
// 机甲切角装饰(仅 clip 形状时显示,通过 shape 控制)
|
|
82
|
+
&::before {
|
|
83
|
+
content: '';
|
|
84
|
+
position: absolute;
|
|
85
|
+
top: -1px;
|
|
86
|
+
right: -1px;
|
|
87
|
+
width: 5px;
|
|
88
|
+
height: 5px;
|
|
89
|
+
background: transparent;
|
|
90
|
+
border-top: 1px solid var(--cp-border);
|
|
91
|
+
border-right: 1px solid var(--cp-border);
|
|
92
|
+
clip-path: polygon(0 0, 100% 0, 100% 100%);
|
|
93
|
+
transition: all 0.25s ease;
|
|
94
|
+
display: none; // 默认隐藏,shape-clip 时显示
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// ===== 图标 =====
|
|
99
|
+
@include e(icon) {
|
|
100
|
+
width: 70%;
|
|
101
|
+
height: 70%;
|
|
102
|
+
color: var(--cp-checkbox-check-color);
|
|
103
|
+
stroke: var(--cp-checkbox-check-color);
|
|
104
|
+
opacity: 0;
|
|
105
|
+
transform: scale(0.5);
|
|
106
|
+
transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
107
|
+
|
|
108
|
+
// 确保 SVG 子元素使用同一颜色(避免继承差异)
|
|
109
|
+
polyline,
|
|
110
|
+
line {
|
|
111
|
+
stroke: var(--cp-checkbox-check-color);
|
|
112
|
+
stroke-width: 3px;
|
|
113
|
+
stroke-linecap: square;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// ===== 标签 =====
|
|
118
|
+
@include e(label) {
|
|
119
|
+
font-weight: 500;
|
|
120
|
+
transition: color 0.2s ease;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// ===== 尺寸 =====
|
|
124
|
+
@each $size-name, $size-config in $checkbox-sizes {
|
|
125
|
+
@include m(#{$size-name}) {
|
|
126
|
+
$size: map.get($size-config, size);
|
|
127
|
+
|
|
128
|
+
--cp-checkbox-size: #{$size};
|
|
129
|
+
|
|
130
|
+
.cp-checkbox__label {
|
|
131
|
+
font-size: map.get($size-config, font-size);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@include when(custom-size) {
|
|
137
|
+
// custom-size 无特殊 clip-path,由 shape modifier 控制
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// ===== 形状 =====
|
|
141
|
+
@include m(shape-clip) {
|
|
142
|
+
.cp-checkbox__indicator {
|
|
143
|
+
clip-path: polygon(
|
|
144
|
+
4px 0,
|
|
145
|
+
100% 0,
|
|
146
|
+
100% calc(100% - 4px),
|
|
147
|
+
calc(100% - 4px) 100%,
|
|
148
|
+
0 100%,
|
|
149
|
+
0 4px
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
&::before {
|
|
153
|
+
display: block;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&.cp-checkbox--sm .cp-checkbox__indicator {
|
|
158
|
+
clip-path: polygon(
|
|
159
|
+
3px 0,
|
|
160
|
+
100% 0,
|
|
161
|
+
100% calc(100% - 3px),
|
|
162
|
+
calc(100% - 3px) 100%,
|
|
163
|
+
0 100%,
|
|
164
|
+
0 3px
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&.cp-checkbox--lg .cp-checkbox__indicator {
|
|
169
|
+
clip-path: polygon(
|
|
170
|
+
5px 0,
|
|
171
|
+
100% 0,
|
|
172
|
+
100% calc(100% - 5px),
|
|
173
|
+
calc(100% - 5px) 100%,
|
|
174
|
+
0 100%,
|
|
175
|
+
0 5px
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@include m(shape-no-clip) {
|
|
181
|
+
.cp-checkbox__indicator {
|
|
182
|
+
clip-path: none;
|
|
183
|
+
|
|
184
|
+
&::before {
|
|
185
|
+
display: none;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@include m(shape-round) {
|
|
191
|
+
.cp-checkbox__indicator {
|
|
192
|
+
clip-path: none;
|
|
193
|
+
border-radius: 4px;
|
|
194
|
+
|
|
195
|
+
&::before {
|
|
196
|
+
display: none;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// ===== 选中状态 =====
|
|
202
|
+
@include when(checked) {
|
|
203
|
+
.cp-checkbox__indicator {
|
|
204
|
+
background: var(--cp-checkbox-active-color);
|
|
205
|
+
border-color: var(--cp-checkbox-active-color);
|
|
206
|
+
box-shadow: 0 0 10px var(--cp-checkbox-active-color-light);
|
|
207
|
+
|
|
208
|
+
&::before {
|
|
209
|
+
border-color: rgba(255, 255, 255, 0.6);
|
|
210
|
+
background: rgba(255, 255, 255, 0.3);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.cp-checkbox__icon {
|
|
215
|
+
opacity: 1;
|
|
216
|
+
transform: scale(1);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// ===== 半选状态 =====
|
|
221
|
+
@include when(indeterminate) {
|
|
222
|
+
.cp-checkbox__indicator {
|
|
223
|
+
background: var(--cp-checkbox-active-color);
|
|
224
|
+
border-color: var(--cp-checkbox-active-color);
|
|
225
|
+
box-shadow: 0 0 10px var(--cp-checkbox-active-color-light);
|
|
226
|
+
|
|
227
|
+
&::before {
|
|
228
|
+
border-color: rgba(255, 255, 255, 0.6);
|
|
229
|
+
background: rgba(255, 255, 255, 0.3);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.cp-checkbox__icon {
|
|
234
|
+
opacity: 1;
|
|
235
|
+
transform: scale(1);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// ===== 边框模式 =====
|
|
240
240
|
@include when(border) {
|
|
241
241
|
padding: 8px 16px;
|
|
242
242
|
border: 1px solid var(--cp-border);
|
|
243
243
|
background: var(--cp-surface);
|
|
244
|
-
transition: all 0.25s ease;
|
|
245
|
-
|
|
246
|
-
&:hover:not(.is-disabled) {
|
|
247
|
-
border-color: var(--cp-checkbox-active-color);
|
|
248
|
-
box-shadow: 0 0 8px var(--cp-checkbox-active-color-light);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
&.is-checked {
|
|
252
|
-
border-color: var(--cp-checkbox-active-color);
|
|
253
|
-
background: color-mix(in srgb, var(--cp-checkbox-active-color) 15%, transparent);
|
|
244
|
+
transition: all 0.25s ease;
|
|
245
|
+
|
|
246
|
+
&:hover:not(.is-disabled) {
|
|
247
|
+
border-color: var(--cp-checkbox-active-color);
|
|
248
|
+
box-shadow: 0 0 8px var(--cp-checkbox-active-color-light);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&.is-checked {
|
|
252
|
+
border-color: var(--cp-checkbox-active-color);
|
|
253
|
+
background: color-mix(in srgb, var(--cp-checkbox-active-color) 15%, transparent);
|
|
254
254
|
box-shadow: 0 0 12px var(--cp-checkbox-active-color-light);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
@@ -265,74 +265,74 @@ $checkbox-sizes: (
|
|
|
265
265
|
|
|
266
266
|
// border + shape 联动
|
|
267
267
|
&.cp-checkbox--shape-clip.is-border {
|
|
268
|
-
clip-path: polygon(
|
|
269
|
-
8px 0,
|
|
270
|
-
100% 0,
|
|
271
|
-
100% calc(100% - 8px),
|
|
272
|
-
calc(100% - 8px) 100%,
|
|
273
|
-
0 100%,
|
|
274
|
-
0 8px
|
|
275
|
-
);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
&.cp-checkbox--shape-no-clip.is-border {
|
|
279
|
-
clip-path: none;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
&.cp-checkbox--shape-round.is-border {
|
|
283
|
-
clip-path: none;
|
|
284
|
-
border-radius: 6px;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// ===== 禁用状态 =====
|
|
288
|
-
@include when(disabled) {
|
|
289
|
-
cursor: not-allowed;
|
|
290
|
-
|
|
291
|
-
.cp-checkbox__label {
|
|
292
|
-
color: var(--cp-text-disabled);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
// 未选中:占位底色 + dashed 边框 表达"禁用且为空"
|
|
296
|
-
&:not(.is-checked):not(.is-indeterminate) {
|
|
297
|
-
.cp-checkbox__indicator {
|
|
298
|
-
background: var(--cp-surface-bright);
|
|
299
|
-
border-color: var(--cp-border-disabled);
|
|
300
|
-
border-style: dashed;
|
|
301
|
-
box-shadow: none;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// 选中 / 半选:保留主题色与勾标,但 dashed 边框 + 半透明
|
|
306
|
-
// 表达"已选但锁定",与正常选中态形成明确区分
|
|
307
|
-
&.is-checked,
|
|
308
|
-
&.is-indeterminate {
|
|
309
|
-
.cp-checkbox__indicator {
|
|
310
|
-
box-shadow: none;
|
|
311
|
-
border-style: dashed;
|
|
312
|
-
opacity: 0.55;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
// 边框模式:外框 dashed + 去发光,让"禁用"在外观上明确可读
|
|
317
|
-
&.is-border {
|
|
318
|
-
border-style: dashed;
|
|
319
|
-
box-shadow: none;
|
|
320
|
-
|
|
321
|
-
&:not(.is-checked):not(.is-indeterminate) {
|
|
322
|
-
border-color: var(--cp-border-disabled);
|
|
323
|
-
background: var(--cp-surface-variant);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
// 选中态:用外层 opacity 整体弱化,并重置内部 indicator opacity,
|
|
327
|
-
// 避免与上面 .is-checked 的 0.55 叠加导致几乎不可见
|
|
328
|
-
&.is-checked,
|
|
329
|
-
&.is-indeterminate {
|
|
330
|
-
opacity: 0.7;
|
|
331
|
-
|
|
332
|
-
.cp-checkbox__indicator {
|
|
333
|
-
opacity: 1;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
}
|
|
268
|
+
clip-path: polygon(
|
|
269
|
+
8px 0,
|
|
270
|
+
100% 0,
|
|
271
|
+
100% calc(100% - 8px),
|
|
272
|
+
calc(100% - 8px) 100%,
|
|
273
|
+
0 100%,
|
|
274
|
+
0 8px
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
&.cp-checkbox--shape-no-clip.is-border {
|
|
279
|
+
clip-path: none;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
&.cp-checkbox--shape-round.is-border {
|
|
283
|
+
clip-path: none;
|
|
284
|
+
border-radius: 6px;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// ===== 禁用状态 =====
|
|
288
|
+
@include when(disabled) {
|
|
289
|
+
cursor: not-allowed;
|
|
290
|
+
|
|
291
|
+
.cp-checkbox__label {
|
|
292
|
+
color: var(--cp-text-disabled);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// 未选中:占位底色 + dashed 边框 表达"禁用且为空"
|
|
296
|
+
&:not(.is-checked):not(.is-indeterminate) {
|
|
297
|
+
.cp-checkbox__indicator {
|
|
298
|
+
background: var(--cp-surface-bright);
|
|
299
|
+
border-color: var(--cp-border-disabled);
|
|
300
|
+
border-style: dashed;
|
|
301
|
+
box-shadow: none;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// 选中 / 半选:保留主题色与勾标,但 dashed 边框 + 半透明
|
|
306
|
+
// 表达"已选但锁定",与正常选中态形成明确区分
|
|
307
|
+
&.is-checked,
|
|
308
|
+
&.is-indeterminate {
|
|
309
|
+
.cp-checkbox__indicator {
|
|
310
|
+
box-shadow: none;
|
|
311
|
+
border-style: dashed;
|
|
312
|
+
opacity: 0.55;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// 边框模式:外框 dashed + 去发光,让"禁用"在外观上明确可读
|
|
317
|
+
&.is-border {
|
|
318
|
+
border-style: dashed;
|
|
319
|
+
box-shadow: none;
|
|
320
|
+
|
|
321
|
+
&:not(.is-checked):not(.is-indeterminate) {
|
|
322
|
+
border-color: var(--cp-border-disabled);
|
|
323
|
+
background: var(--cp-surface-variant);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// 选中态:用外层 opacity 整体弱化,并重置内部 indicator opacity,
|
|
327
|
+
// 避免与上面 .is-checked 的 0.55 叠加导致几乎不可见
|
|
328
|
+
&.is-checked,
|
|
329
|
+
&.is-indeterminate {
|
|
330
|
+
opacity: 0.7;
|
|
331
|
+
|
|
332
|
+
.cp-checkbox__indicator {
|
|
333
|
+
opacity: 1;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|