@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.
Files changed (47) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.css.map +1 -1
  3. package/package.json +1 -1
  4. package/src/common/var.scss +247 -247
  5. package/src/components/avatar-group.scss +113 -113
  6. package/src/components/avatar.scss +123 -123
  7. package/src/components/badge.scss +210 -210
  8. package/src/components/breadcrumb.scss +203 -203
  9. package/src/components/button.scss +975 -975
  10. package/src/components/card.scss +699 -696
  11. package/src/components/checkbox-group.scss +22 -22
  12. package/src/components/checkbox.scss +320 -320
  13. package/src/components/col.scss +43 -43
  14. package/src/components/dialog.scss +360 -360
  15. package/src/components/divider.scss +250 -250
  16. package/src/components/empty.scss +99 -99
  17. package/src/components/form-item.scss +189 -189
  18. package/src/components/form.scss +59 -59
  19. package/src/components/icon.scss +83 -83
  20. package/src/components/image-preview.scss +147 -147
  21. package/src/components/image.scss +351 -351
  22. package/src/components/input-number.scss +129 -129
  23. package/src/components/input.scss +362 -362
  24. package/src/components/loading.scss +64 -64
  25. package/src/components/notification.scss +348 -348
  26. package/src/components/pagination.scss +287 -280
  27. package/src/components/pattern-background.scss +18 -18
  28. package/src/components/popover.scss +438 -438
  29. package/src/components/progress.scss +438 -438
  30. package/src/components/radio-group.scss +22 -22
  31. package/src/components/radio.scss +286 -286
  32. package/src/components/row.scss +12 -12
  33. package/src/components/scrollbar.scss +40 -40
  34. package/src/components/segmented.scss +566 -566
  35. package/src/components/select.scss +15 -1
  36. package/src/components/slider.scss +421 -421
  37. package/src/components/status-indicator.scss +206 -206
  38. package/src/components/switch.scss +405 -405
  39. package/src/components/table.scss +474 -474
  40. package/src/components/tag.scss +416 -416
  41. package/src/components/text.scss +310 -271
  42. package/src/components/textarea.scss +106 -104
  43. package/src/components/timeline.scss +379 -379
  44. package/src/components/tree.scss +397 -397
  45. package/src/components/upload.scss +509 -509
  46. package/src/index.scss +60 -60
  47. package/src/mixins/mixins.scss +156 -156
@@ -1,215 +1,215 @@
1
- // CpProgress 组件样式
2
- // 赛博朋克/机甲风格
3
-
4
- @use '../common/var' as *;
5
- @use '../mixins/mixins' as *;
6
-
7
- @include b(progress) {
8
- position: relative;
9
- display: flex;
10
- align-items: center;
11
- width: 100%;
12
- font-family: var(--cp-font-family-ui);
13
-
14
- // ===== 线性进度条 =====
15
- @include m(line) {
16
- flex-direction: row;
17
- }
18
-
19
- @include e(outer) {
20
- flex: 1;
21
- position: relative;
22
- // 移除 outer 的 clip-path 防止布局塌陷
23
- }
24
-
25
- @include e(inner) {
26
- position: relative;
27
- width: 100%;
28
- background: var(--cp-bg-deep, #0a0a0f); // 使用更深色的背景作为轨道
29
- border: 1px solid var(--cp-border);
30
- overflow: hidden;
31
-
32
- // 机甲风切角 (Top-Left, Bottom-Right)
33
- clip-path: polygon(4px 0,
34
- 100% 0,
35
- 100% calc(100% - 4px),
36
- calc(100% - 4px) 100%,
37
- 0 100%,
38
- 0 4px);
39
- }
40
-
41
- // ===== Step 模式:分段进度条 =====
42
- @include e(steps) {
43
- display: flex;
44
- background: transparent;
45
- border: none;
46
- clip-path: none;
47
- }
48
-
49
- @include e(step) {
50
- flex: 1;
51
- height: 100%;
52
- background: var(--cp-bg-deep);
53
- border: 1px solid var(--cp-border);
54
- transition: background 0.3s ease, box-shadow 0.3s ease;
55
-
56
- // 切角形状
57
- clip-path: polygon(
58
- 3px 0,
59
- 100% 0,
60
- 100% calc(100% - 3px),
61
- calc(100% - 3px) 100%,
62
- 0 100%,
63
- 0 3px
64
- );
65
-
66
- // 完成状态
67
- @include when(full) {
68
- background: var(--cp-progress-color, var(--cp-color-success));
69
- box-shadow: 0 0 8px var(--cp-progress-color, var(--cp-color-success)),
70
- inset 0 0 4px rgba(255, 255, 255, 0.2);
71
- }
72
-
73
- // 当前状态(脉冲动效)
74
- @include when(current) {
75
- background: var(--cp-progress-color, var(--cp-color-warning));
76
- animation: cp-progress-step-pulse 1.5s ease-in-out infinite;
77
- }
78
- }
79
-
80
- @include e(bar) {
81
- position: relative;
82
- height: 100%;
83
- background: var(--cp-progress-color, var(--cp-color-primary));
84
- transition: width 0.3s ease;
85
- display: flex;
86
- align-items: center;
87
- justify-content: flex-end;
88
- overflow: hidden;
89
-
90
- // 霓虹发光效果
91
- box-shadow:
92
- 0 0 8px var(--cp-progress-color, var(--cp-color-primary)),
93
- inset 0 0 4px rgba(255, 255, 255, 0.2);
94
-
95
- // 光波扫过效果 (默认隐藏)
96
- &::after {
97
- content: '';
98
- position: absolute;
99
- top: 0;
100
- left: -100%;
101
- width: 100%;
102
- height: 100%;
103
- background: linear-gradient(
104
- 90deg,
105
- transparent 0%,
106
- rgba(255, 255, 255, 0.05) 15%,
107
- rgba(255, 255, 255, 0.7) 50%,
108
- rgba(255, 255, 255, 0.05) 85%,
109
- transparent 100%
110
- );
111
- filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
112
- pointer-events: none;
113
- // 默认不播放动画
114
- animation: none;
115
- }
116
- }
117
-
118
- // ===== 加载状态 =====
119
- @include when(loading) {
120
- .cp-progress__bar::after {
121
- animation: cp-progress-shimmer 2s ease-in-out infinite;
122
- }
123
- }
124
-
125
- @include e(innerText) {
126
- padding: 0 var(--cp-spacing-xs);
127
- font-size: 0.75em; // 相对于进度条高度,保持文字不会撑满
128
- // 优先使用用户自定义颜色,其次回退到亮色背景文字变量
129
- color: var(--cp-progress-text-color, var(--cp-text-on-bright));
130
- white-space: nowrap;
131
- font-weight: bold;
132
- text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
133
- }
134
-
135
- @include e(text) {
136
- margin-left: var(--cp-spacing-sm);
137
- font-size: var(--cp-font-size-sm);
138
- color: var(--cp-text-secondary);
139
- white-space: nowrap;
140
- font-weight: 600;
141
- letter-spacing: 0.05em;
142
- min-width: 50px; // 保持 100% 宽度稳定,防止抖动
143
- flex-shrink: 0;
144
- user-select: none;
145
- }
146
-
147
- // ===== 尺寸变体 =====
148
- @include m(sm) {
149
- .cp-progress__text {
150
- font-size: var(--cp-font-size-sm); // 修正: 使用 sm
151
- }
152
- }
153
-
154
- @include m(lg) {
155
- .cp-progress__text {
156
- font-size: var(--cp-font-size-md);
157
- }
158
-
159
- .cp-progress__inner {
160
- clip-path: polygon(8px 0,
161
- 100% 0,
162
- 100% calc(100% - 8px),
163
- calc(100% - 8px) 100%,
164
- 0 100%,
165
- 0 8px);
166
- }
167
- }
168
-
169
- @include m(xl) {
170
- .cp-progress__text {
171
- font-size: var(--cp-font-size-lg);
172
- }
173
-
174
- .cp-progress__inner {
175
- clip-path: polygon(12px 0,
176
- 100% 0,
177
- 100% calc(100% - 12px),
178
- calc(100% - 12px) 100%,
179
- 0 100%,
180
- 0 12px);
181
- }
182
- }
183
-
184
- @include m(xxl) {
185
- .cp-progress__text {
186
- font-size: 1.25rem;
187
- }
188
-
189
- .cp-progress__inner {
190
- clip-path: polygon(16px 0,
191
- 100% 0,
192
- 100% calc(100% - 16px),
193
- calc(100% - 16px) 100%,
194
- 0 100%,
195
- 0 16px);
196
- }
197
- }
198
-
199
- // ===== 形状变体 =====
200
- @include m(shape-no-clip) {
201
- .cp-progress__inner {
202
- clip-path: none;
203
- }
204
- }
205
-
206
- @include m(shape-round) {
207
- .cp-progress__inner {
208
- clip-path: none;
209
- border-radius: 100px; // 对于进度条,全圆角更美观
210
- }
211
- }
212
-
1
+ // CpProgress 组件样式
2
+ // 赛博朋克/机甲风格
3
+
4
+ @use '../common/var' as *;
5
+ @use '../mixins/mixins' as *;
6
+
7
+ @include b(progress) {
8
+ position: relative;
9
+ display: flex;
10
+ align-items: center;
11
+ width: 100%;
12
+ font-family: var(--cp-font-family-ui);
13
+
14
+ // ===== 线性进度条 =====
15
+ @include m(line) {
16
+ flex-direction: row;
17
+ }
18
+
19
+ @include e(outer) {
20
+ flex: 1;
21
+ position: relative;
22
+ // 移除 outer 的 clip-path 防止布局塌陷
23
+ }
24
+
25
+ @include e(inner) {
26
+ position: relative;
27
+ width: 100%;
28
+ background: var(--cp-bg-deep, #0a0a0f); // 使用更深色的背景作为轨道
29
+ border: 1px solid var(--cp-border);
30
+ overflow: hidden;
31
+
32
+ // 机甲风切角 (Top-Left, Bottom-Right)
33
+ clip-path: polygon(4px 0,
34
+ 100% 0,
35
+ 100% calc(100% - 4px),
36
+ calc(100% - 4px) 100%,
37
+ 0 100%,
38
+ 0 4px);
39
+ }
40
+
41
+ // ===== Step 模式:分段进度条 =====
42
+ @include e(steps) {
43
+ display: flex;
44
+ background: transparent;
45
+ border: none;
46
+ clip-path: none;
47
+ }
48
+
49
+ @include e(step) {
50
+ flex: 1;
51
+ height: 100%;
52
+ background: var(--cp-bg-deep);
53
+ border: 1px solid var(--cp-border);
54
+ transition: background 0.3s ease, box-shadow 0.3s ease;
55
+
56
+ // 切角形状
57
+ clip-path: polygon(
58
+ 3px 0,
59
+ 100% 0,
60
+ 100% calc(100% - 3px),
61
+ calc(100% - 3px) 100%,
62
+ 0 100%,
63
+ 0 3px
64
+ );
65
+
66
+ // 完成状态
67
+ @include when(full) {
68
+ background: var(--cp-progress-color, var(--cp-color-success));
69
+ box-shadow: 0 0 8px var(--cp-progress-color, var(--cp-color-success)),
70
+ inset 0 0 4px rgba(255, 255, 255, 0.2);
71
+ }
72
+
73
+ // 当前状态(脉冲动效)
74
+ @include when(current) {
75
+ background: var(--cp-progress-color, var(--cp-color-warning));
76
+ animation: cp-progress-step-pulse 1.5s ease-in-out infinite;
77
+ }
78
+ }
79
+
80
+ @include e(bar) {
81
+ position: relative;
82
+ height: 100%;
83
+ background: var(--cp-progress-color, var(--cp-color-primary));
84
+ transition: width 0.3s ease;
85
+ display: flex;
86
+ align-items: center;
87
+ justify-content: flex-end;
88
+ overflow: hidden;
89
+
90
+ // 霓虹发光效果
91
+ box-shadow:
92
+ 0 0 8px var(--cp-progress-color, var(--cp-color-primary)),
93
+ inset 0 0 4px rgba(255, 255, 255, 0.2);
94
+
95
+ // 光波扫过效果 (默认隐藏)
96
+ &::after {
97
+ content: '';
98
+ position: absolute;
99
+ top: 0;
100
+ left: -100%;
101
+ width: 100%;
102
+ height: 100%;
103
+ background: linear-gradient(
104
+ 90deg,
105
+ transparent 0%,
106
+ rgba(255, 255, 255, 0.05) 15%,
107
+ rgba(255, 255, 255, 0.7) 50%,
108
+ rgba(255, 255, 255, 0.05) 85%,
109
+ transparent 100%
110
+ );
111
+ filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
112
+ pointer-events: none;
113
+ // 默认不播放动画
114
+ animation: none;
115
+ }
116
+ }
117
+
118
+ // ===== 加载状态 =====
119
+ @include when(loading) {
120
+ .cp-progress__bar::after {
121
+ animation: cp-progress-shimmer 2s ease-in-out infinite;
122
+ }
123
+ }
124
+
125
+ @include e(innerText) {
126
+ padding: 0 var(--cp-spacing-xs);
127
+ font-size: 0.75em; // 相对于进度条高度,保持文字不会撑满
128
+ // 优先使用用户自定义颜色,其次回退到亮色背景文字变量
129
+ color: var(--cp-progress-text-color, var(--cp-text-on-bright));
130
+ white-space: nowrap;
131
+ font-weight: bold;
132
+ text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
133
+ }
134
+
135
+ @include e(text) {
136
+ margin-left: var(--cp-spacing-sm);
137
+ font-size: var(--cp-font-size-sm);
138
+ color: var(--cp-text-secondary);
139
+ white-space: nowrap;
140
+ font-weight: 600;
141
+ letter-spacing: 0.05em;
142
+ min-width: 50px; // 保持 100% 宽度稳定,防止抖动
143
+ flex-shrink: 0;
144
+ user-select: none;
145
+ }
146
+
147
+ // ===== 尺寸变体 =====
148
+ @include m(sm) {
149
+ .cp-progress__text {
150
+ font-size: var(--cp-font-size-sm); // 修正: 使用 sm
151
+ }
152
+ }
153
+
154
+ @include m(lg) {
155
+ .cp-progress__text {
156
+ font-size: var(--cp-font-size-md);
157
+ }
158
+
159
+ .cp-progress__inner {
160
+ clip-path: polygon(8px 0,
161
+ 100% 0,
162
+ 100% calc(100% - 8px),
163
+ calc(100% - 8px) 100%,
164
+ 0 100%,
165
+ 0 8px);
166
+ }
167
+ }
168
+
169
+ @include m(xl) {
170
+ .cp-progress__text {
171
+ font-size: var(--cp-font-size-lg);
172
+ }
173
+
174
+ .cp-progress__inner {
175
+ clip-path: polygon(12px 0,
176
+ 100% 0,
177
+ 100% calc(100% - 12px),
178
+ calc(100% - 12px) 100%,
179
+ 0 100%,
180
+ 0 12px);
181
+ }
182
+ }
183
+
184
+ @include m(xxl) {
185
+ .cp-progress__text {
186
+ font-size: 1.25rem;
187
+ }
188
+
189
+ .cp-progress__inner {
190
+ clip-path: polygon(16px 0,
191
+ 100% 0,
192
+ 100% calc(100% - 16px),
193
+ calc(100% - 16px) 100%,
194
+ 0 100%,
195
+ 0 16px);
196
+ }
197
+ }
198
+
199
+ // ===== 形状变体 =====
200
+ @include m(shape-no-clip) {
201
+ .cp-progress__inner {
202
+ clip-path: none;
203
+ }
204
+ }
205
+
206
+ @include m(shape-round) {
207
+ .cp-progress__inner {
208
+ clip-path: none;
209
+ border-radius: 100px; // 对于进度条,全圆角更美观
210
+ }
211
+ }
212
+
213
213
  // ===== 状态颜色 =====
214
214
  @include when(primary) {
215
215
  --cp-progress-color: var(--cp-color-primary);
@@ -221,20 +221,20 @@
221
221
 
222
222
  @include when(success) {
223
223
  --cp-progress-color: var(--cp-color-success);
224
-
225
- .cp-progress__text {
226
- color: var(--cp-color-success);
227
- }
228
- }
229
-
230
- @include when(warning) {
231
- --cp-progress-color: var(--cp-color-warning);
232
-
233
- .cp-progress__text {
234
- color: var(--cp-color-warning);
235
- }
236
- }
237
-
224
+
225
+ .cp-progress__text {
226
+ color: var(--cp-color-success);
227
+ }
228
+ }
229
+
230
+ @include when(warning) {
231
+ --cp-progress-color: var(--cp-color-warning);
232
+
233
+ .cp-progress__text {
234
+ color: var(--cp-color-warning);
235
+ }
236
+ }
237
+
238
238
  @include when(error) {
239
239
  --cp-progress-color: var(--cp-color-error);
240
240
 
@@ -250,76 +250,76 @@
250
250
  color: var(--cp-color-info);
251
251
  }
252
252
  }
253
-
254
- // ===== 条纹效果 =====
255
- @include when(striped) {
256
- .cp-progress__bar {
257
- background-image: linear-gradient(
258
- 45deg,
259
- rgba(255, 255, 255, 0.4) 25%,
260
- rgba(0, 0, 0, 0.1) 25%,
261
- rgba(0, 0, 0, 0.1) 50%,
262
- rgba(255, 255, 255, 0.4) 50%,
263
- rgba(255, 255, 255, 0.4) 75%,
264
- rgba(0, 0, 0, 0.1) 75%,
265
- rgba(0, 0, 0, 0.1)
266
- );
267
- background-size: 24px 24px;
268
- }
269
- }
270
-
271
- @include when(striped-flow) {
272
- .cp-progress__bar {
273
- animation: cp-progress-striped-flow 1s linear infinite;
274
- }
275
- }
276
-
277
- // ===== 不确定模式 =====
278
- @include when(indeterminate) {
279
- .cp-progress__bar {
280
- width: 40% !important;
281
- position: absolute;
282
- animation: cp-progress-indeterminate 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
283
-
284
- // 增强发光效果
285
- box-shadow:
286
- 0 0 12px var(--cp-progress-color, var(--cp-color-primary)),
287
- 0 0 24px var(--cp-progress-color, var(--cp-color-primary)),
288
- inset 0 0 6px rgba(255, 255, 255, 0.3);
289
- }
290
-
291
- .cp-progress__indeterminate {
292
- stroke: var(--cp-progress-color, var(--cp-color-primary));
293
- stroke-dasharray: 90, 150;
294
- stroke-dashoffset: 0;
295
- transform-origin: center;
296
- animation: cp-circle-indeterminate 1.5s ease-in-out infinite;
297
- // 移除发光,保持利落感
298
- }
299
- }
300
-
301
- // ===== 环形进度条 =====
302
- @include m(circle) {
303
- flex-direction: column;
304
- justify-content: center;
305
- align-items: center;
306
- width: auto;
307
- padding: 6px; // 预留发光空间
308
- }
309
-
310
- @include m(dashboard) {
311
- flex-direction: column;
312
- justify-content: center;
313
- align-items: center;
314
- width: auto;
315
- padding: 6px; // 预留发光空间
316
- }
317
-
318
- @include e(circle) {
319
- display: block;
320
- overflow: visible; // 解决发光裁剪问题
321
- }
322
-
253
+
254
+ // ===== 条纹效果 =====
255
+ @include when(striped) {
256
+ .cp-progress__bar {
257
+ background-image: linear-gradient(
258
+ 45deg,
259
+ rgba(255, 255, 255, 0.4) 25%,
260
+ rgba(0, 0, 0, 0.1) 25%,
261
+ rgba(0, 0, 0, 0.1) 50%,
262
+ rgba(255, 255, 255, 0.4) 50%,
263
+ rgba(255, 255, 255, 0.4) 75%,
264
+ rgba(0, 0, 0, 0.1) 75%,
265
+ rgba(0, 0, 0, 0.1)
266
+ );
267
+ background-size: 24px 24px;
268
+ }
269
+ }
270
+
271
+ @include when(striped-flow) {
272
+ .cp-progress__bar {
273
+ animation: cp-progress-striped-flow 1s linear infinite;
274
+ }
275
+ }
276
+
277
+ // ===== 不确定模式 =====
278
+ @include when(indeterminate) {
279
+ .cp-progress__bar {
280
+ width: 40% !important;
281
+ position: absolute;
282
+ animation: cp-progress-indeterminate 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
283
+
284
+ // 增强发光效果
285
+ box-shadow:
286
+ 0 0 12px var(--cp-progress-color, var(--cp-color-primary)),
287
+ 0 0 24px var(--cp-progress-color, var(--cp-color-primary)),
288
+ inset 0 0 6px rgba(255, 255, 255, 0.3);
289
+ }
290
+
291
+ .cp-progress__indeterminate {
292
+ stroke: var(--cp-progress-color, var(--cp-color-primary));
293
+ stroke-dasharray: 90, 150;
294
+ stroke-dashoffset: 0;
295
+ transform-origin: center;
296
+ animation: cp-circle-indeterminate 1.5s ease-in-out infinite;
297
+ // 移除发光,保持利落感
298
+ }
299
+ }
300
+
301
+ // ===== 环形进度条 =====
302
+ @include m(circle) {
303
+ flex-direction: column;
304
+ justify-content: center;
305
+ align-items: center;
306
+ width: auto;
307
+ padding: 6px; // 预留发光空间
308
+ }
309
+
310
+ @include m(dashboard) {
311
+ flex-direction: column;
312
+ justify-content: center;
313
+ align-items: center;
314
+ width: auto;
315
+ padding: 6px; // 预留发光空间
316
+ }
317
+
318
+ @include e(circle) {
319
+ display: block;
320
+ overflow: visible; // 解决发光裁剪问题
321
+ }
322
+
323
323
  @include e(track) {
324
324
  stroke: var(--cp-border);
325
325
  opacity: 0.35; // 略微提高轨道可见度
@@ -338,145 +338,145 @@
338
338
  @include e(inner-track) {
339
339
  stroke: var(--cp-text-disabled);
340
340
  // 静止,无动画,利落感
341
- }
342
-
343
- @include e(path) {
344
- // 默认使用 stroke(用于 round 模式的 circle 元素)
345
- stroke: var(--cp-progress-color, var(--cp-color-primary));
346
- fill: none; // 默认无填充
347
- // 移除 transition: all,防止浏览器对 'd' 属性进行错误的插值导致抖动
348
- // 颜色变化可以通过父级或特定属性过渡,或者不使用过渡以保持机甲风格的利落感
349
- transition: stroke 0.3s ease, fill 0.3s ease;
350
- }
351
-
352
- // 路径模式下使用 fill (clip/no-clip)
353
- &.cp-progress--shape-clip,
354
- &.cp-progress--shape-no-clip {
355
- .cp-progress__path {
356
- fill: var(--cp-progress-color, var(--cp-color-primary));
357
- stroke: none;
358
- }
359
- }
360
-
361
- // 圆角模式保持 stroke
362
- &.cp-progress--shape-round {
363
- .cp-progress__path {
364
- fill: none;
365
- stroke: var(--cp-progress-color, var(--cp-color-primary));
366
- }
367
- }
368
-
369
- // 环形模式下的文字居中
370
- &.cp-progress--circle,
371
- &.cp-progress--dashboard {
372
- .cp-progress__text {
373
- position: absolute;
374
- top: 50%;
375
- left: 50%;
376
- transform: translate(-50%, -50%);
377
- margin: 0;
378
- text-align: center;
379
- // 优先级:SCSS 覆盖 > JS 按 width 动态计算 > 默认 lg
380
- font-size: var(--cp-progress-circle-font-size, var(--cp-font-size-lg));
381
- font-weight: 700;
382
- color: var(--cp-text-primary);
383
- }
384
- }
385
-
386
- // ===== 文字在内部 =====
387
- @include when(text-inside) {
388
- .cp-progress__text {
389
- display: none;
390
- }
391
- }
392
-
393
- // ===== 自定义颜色 =====
394
- @include when(custom-color) {
395
- .cp-progress__bar {
396
- background-color: var(--cp-progress-color);
397
- }
398
-
399
- .cp-progress__path {
400
- stroke: var(--cp-progress-color);
401
- // 无发光
402
- }
403
-
404
- .cp-progress__indeterminate {
405
- stroke: var(--cp-progress-color);
406
- // 无发光
407
- }
408
- }
409
- }
410
-
411
- // ===== 动画 =====
412
- @keyframes cp-progress-striped-flow {
413
- 0% {
414
- background-position: 0 0;
415
- }
416
-
417
- 100% {
418
- background-position: 24px 0;
419
- }
420
- }
421
-
422
- // 线性不确定进度动画 - 更流畅的移动
423
- @keyframes cp-progress-indeterminate {
424
- 0% {
425
- left: -40%;
426
- }
427
- 100% {
428
- left: 100%;
429
- }
430
- }
431
-
432
- // 环形不确定进度动画 - Google Material Design 风格
433
- @keyframes cp-circle-indeterminate {
434
- 0% {
435
- stroke-dasharray: 1, 200;
436
- stroke-dashoffset: 0;
437
- transform: rotate(0deg);
438
- }
439
- 50% {
440
- stroke-dasharray: 100, 200;
441
- stroke-dashoffset: -35;
442
- }
443
- 100% {
444
- stroke-dasharray: 100, 200;
445
- stroke-dashoffset: -125;
446
- transform: rotate(360deg);
447
- }
448
- }
449
-
450
- // 光波扫过动画
451
- @keyframes cp-progress-shimmer {
452
- 0% {
453
- left: -100%;
454
- }
455
- 100% {
456
- left: 200%;
457
- }
458
- }
459
-
460
- // 纯旋转
461
- @keyframes cp-circle-rotate {
462
- 0% {
463
- transform: rotate(0deg);
464
- }
465
- 100% {
466
- transform: rotate(360deg);
467
- }
468
- }
469
-
470
- // Step 模式脉冲动效
471
- @keyframes cp-progress-step-pulse {
472
- 0%, 100% {
473
- opacity: 1;
474
- box-shadow: 0 0 8px var(--cp-progress-color, var(--cp-color-warning)),
475
- inset 0 0 4px rgba(255, 255, 255, 0.2);
476
- }
477
- 50% {
478
- opacity: 0.7;
479
- box-shadow: 0 0 16px var(--cp-progress-color, var(--cp-color-warning)),
480
- inset 0 0 8px rgba(255, 255, 255, 0.3);
481
- }
482
- }
341
+ }
342
+
343
+ @include e(path) {
344
+ // 默认使用 stroke(用于 round 模式的 circle 元素)
345
+ stroke: var(--cp-progress-color, var(--cp-color-primary));
346
+ fill: none; // 默认无填充
347
+ // 移除 transition: all,防止浏览器对 'd' 属性进行错误的插值导致抖动
348
+ // 颜色变化可以通过父级或特定属性过渡,或者不使用过渡以保持机甲风格的利落感
349
+ transition: stroke 0.3s ease, fill 0.3s ease;
350
+ }
351
+
352
+ // 路径模式下使用 fill (clip/no-clip)
353
+ &.cp-progress--shape-clip,
354
+ &.cp-progress--shape-no-clip {
355
+ .cp-progress__path {
356
+ fill: var(--cp-progress-color, var(--cp-color-primary));
357
+ stroke: none;
358
+ }
359
+ }
360
+
361
+ // 圆角模式保持 stroke
362
+ &.cp-progress--shape-round {
363
+ .cp-progress__path {
364
+ fill: none;
365
+ stroke: var(--cp-progress-color, var(--cp-color-primary));
366
+ }
367
+ }
368
+
369
+ // 环形模式下的文字居中
370
+ &.cp-progress--circle,
371
+ &.cp-progress--dashboard {
372
+ .cp-progress__text {
373
+ position: absolute;
374
+ top: 50%;
375
+ left: 50%;
376
+ transform: translate(-50%, -50%);
377
+ margin: 0;
378
+ text-align: center;
379
+ // 优先级:SCSS 覆盖 > JS 按 width 动态计算 > 默认 lg
380
+ font-size: var(--cp-progress-circle-font-size, var(--cp-font-size-lg));
381
+ font-weight: 700;
382
+ color: var(--cp-text-primary);
383
+ }
384
+ }
385
+
386
+ // ===== 文字在内部 =====
387
+ @include when(text-inside) {
388
+ .cp-progress__text {
389
+ display: none;
390
+ }
391
+ }
392
+
393
+ // ===== 自定义颜色 =====
394
+ @include when(custom-color) {
395
+ .cp-progress__bar {
396
+ background-color: var(--cp-progress-color);
397
+ }
398
+
399
+ .cp-progress__path {
400
+ stroke: var(--cp-progress-color);
401
+ // 无发光
402
+ }
403
+
404
+ .cp-progress__indeterminate {
405
+ stroke: var(--cp-progress-color);
406
+ // 无发光
407
+ }
408
+ }
409
+ }
410
+
411
+ // ===== 动画 =====
412
+ @keyframes cp-progress-striped-flow {
413
+ 0% {
414
+ background-position: 0 0;
415
+ }
416
+
417
+ 100% {
418
+ background-position: 24px 0;
419
+ }
420
+ }
421
+
422
+ // 线性不确定进度动画 - 更流畅的移动
423
+ @keyframes cp-progress-indeterminate {
424
+ 0% {
425
+ left: -40%;
426
+ }
427
+ 100% {
428
+ left: 100%;
429
+ }
430
+ }
431
+
432
+ // 环形不确定进度动画 - Google Material Design 风格
433
+ @keyframes cp-circle-indeterminate {
434
+ 0% {
435
+ stroke-dasharray: 1, 200;
436
+ stroke-dashoffset: 0;
437
+ transform: rotate(0deg);
438
+ }
439
+ 50% {
440
+ stroke-dasharray: 100, 200;
441
+ stroke-dashoffset: -35;
442
+ }
443
+ 100% {
444
+ stroke-dasharray: 100, 200;
445
+ stroke-dashoffset: -125;
446
+ transform: rotate(360deg);
447
+ }
448
+ }
449
+
450
+ // 光波扫过动画
451
+ @keyframes cp-progress-shimmer {
452
+ 0% {
453
+ left: -100%;
454
+ }
455
+ 100% {
456
+ left: 200%;
457
+ }
458
+ }
459
+
460
+ // 纯旋转
461
+ @keyframes cp-circle-rotate {
462
+ 0% {
463
+ transform: rotate(0deg);
464
+ }
465
+ 100% {
466
+ transform: rotate(360deg);
467
+ }
468
+ }
469
+
470
+ // Step 模式脉冲动效
471
+ @keyframes cp-progress-step-pulse {
472
+ 0%, 100% {
473
+ opacity: 1;
474
+ box-shadow: 0 0 8px var(--cp-progress-color, var(--cp-color-warning)),
475
+ inset 0 0 4px rgba(255, 255, 255, 0.2);
476
+ }
477
+ 50% {
478
+ opacity: 0.7;
479
+ box-shadow: 0 0 16px var(--cp-progress-color, var(--cp-color-warning)),
480
+ inset 0 0 8px rgba(255, 255, 255, 0.3);
481
+ }
482
+ }