@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,416 +1,416 @@
1
- // CpTag 组件样式
2
- // 赛博朋克/机甲风格
3
-
4
- @use "sass:map";
5
- @use "../common/var" as *;
6
- @use "../mixins/mixins" as *;
7
-
8
- // Tag 尺寸配置
9
- $tag-sizes: (
10
- sm: (
11
- height: 20px,
12
- padding: 0 6px,
13
- font-size: 11px,
14
- clip: 4px,
15
- close-size: 12px,
16
- ),
17
- md: (
18
- height: 24px,
19
- padding: 0 8px,
20
- font-size: 12px,
21
- clip: 5px,
22
- close-size: 14px,
23
- ),
24
- lg: (
25
- height: 28px,
26
- padding: 0 10px,
27
- font-size: 13px,
28
- clip: 6px,
29
- close-size: 16px,
30
- ),
31
- );
32
-
33
- // 颜色映射
34
- $tag-types: (
35
- primary: var(--cp-color-primary),
36
- success: var(--cp-color-success),
37
- warning: var(--cp-color-warning),
38
- error: var(--cp-color-error),
39
- info: var(--cp-color-info),
40
- );
41
-
42
- @include b(tag) {
43
- // 基础样式
44
- position: relative;
45
- display: inline-flex;
46
- align-items: center;
47
- justify-content: center;
48
- box-sizing: border-box;
49
- vertical-align: middle;
50
- font-family: var(--cp-font-family-ui);
51
- font-weight: 500;
52
- white-space: nowrap;
53
- user-select: none;
54
- cursor: default;
55
- transition: all 0.2s ease;
56
-
57
- // CSS 变量默认值
58
- --cp-tag-color: var(--cp-text-secondary);
59
- --cp-tag-color-light: color-mix(in srgb, var(--cp-tag-color) 10%, transparent);
60
- --cp-tag-bg: var(--cp-tag-color);
61
- --cp-tag-border: var(--cp-tag-color);
62
- --cp-tag-clip: 5px;
63
- // 使用 color-contrast 自动选择最佳对比色 (黑或白)
64
- --cp-tag-text: color-contrast(var(--cp-tag-color) vs #000, #fff);
65
-
66
- // ===== 内容区域 =====
67
- @include e(content) {
68
- display: inline-flex;
69
- align-items: center;
70
- }
71
-
72
- // ===== 关闭按钮 =====
73
- @include e(close) {
74
- display: inline-flex;
75
- align-items: center;
76
- justify-content: center;
77
- margin-left: 4px;
78
- cursor: pointer;
79
- opacity: 0.7;
80
- transition: all 0.15s ease;
81
- border-radius: 2px;
82
-
83
- svg {
84
- width: 100%;
85
- height: 100%;
86
- }
87
-
88
- &:hover {
89
- opacity: 1;
90
- background: rgba(255, 255, 255, 0.15);
91
- }
92
-
93
- &:active {
94
- transform: scale(0.9);
95
- }
96
- }
97
-
98
- // ===== 装饰块 (clip 模式右上角) =====
99
- @include e(decor) {
100
- position: absolute;
101
- top: -1px;
102
- right: -1px;
103
- width: 5px;
104
- height: 5px;
105
- background: var(--cp-tag-color);
106
- clip-path: polygon(0 0, 100% 0, 100% 100%);
107
- opacity: 0.8;
108
- pointer-events: none;
109
- transition: opacity 0.2s ease;
110
- }
111
-
112
- // ===== 尺寸变体 =====
113
- @each $size-name, $size-config in $tag-sizes {
114
- @include m(#{$size-name}) {
115
- height: map.get($size-config, height);
116
- padding: map.get($size-config, padding);
117
- font-size: map.get($size-config, font-size);
118
- --cp-tag-clip: #{map.get($size-config, clip)};
119
-
120
- .cp-tag__close {
121
- width: map.get($size-config, close-size);
122
- height: map.get($size-config, close-size);
123
- }
124
- }
125
- }
126
-
127
-
128
- // ===== 变体样式 =====
129
- // Solid - 实心填充 (文字颜色由 is-typed / default 规则分别处理)
130
- @include m(variant-solid) {
131
- background: var(--cp-tag-color);
132
- border: 1px solid transparent;
133
-
134
- .cp-tag__decor {
135
- background: rgba(255, 255, 255, 0.5);
136
- }
137
-
138
- // 关闭按钮 hover 背景
139
- .cp-tag__close:hover {
140
- background: rgba(0, 0, 0, 0.15);
141
- }
142
- }
143
-
144
- // Outline - 边框描边
145
- @include m(variant-outline) {
146
- background: transparent;
147
- color: var(--cp-tag-color);
148
- border: 1px solid var(--cp-tag-color);
149
-
150
- .cp-tag__decor {
151
- background: var(--cp-tag-color);
152
- }
153
- }
154
-
155
- // Semi - 半透明填充
156
- @include m(variant-semi) {
157
- background: var(--cp-tag-color-light);
158
- color: var(--cp-tag-color);
159
- border: 1px solid var(--cp-tag-color);
160
- backdrop-filter: blur(4px);
161
-
162
- .cp-tag__decor {
163
- background: var(--cp-tag-color);
164
- }
165
- }
166
-
167
- // Note - 便利贴风格 (左边框 + 半透明背景)
168
- @include m(variant-note) {
169
- background: rgba(0, 0, 0, 0.4);
170
- color: var(--cp-tag-color);
171
- border: none;
172
- border-left: 2px solid var(--cp-tag-color);
173
- border-radius: 0;
174
- clip-path: none;
175
- gap: 8px;
176
- padding: 6px 12px;
177
- height: auto;
178
- min-height: 32px;
179
-
180
- .cp-tag__decor {
181
- display: none;
182
- }
183
-
184
- .cp-tag__prefix {
185
- display: flex;
186
- align-items: center;
187
- gap: 4px;
188
- font-size: 10px;
189
- text-transform: uppercase;
190
- letter-spacing: 0.05em;
191
- opacity: 0.8;
192
- }
193
-
194
- .cp-tag__content {
195
- display: flex;
196
- align-items: center;
197
- gap: 4px;
198
- font-size: 10px;
199
- text-transform: uppercase;
200
- letter-spacing: 0.05em;
201
- opacity: 0.8;
202
- }
203
-
204
- .cp-tag__suffix {
205
- font-size: 18px;
206
- font-weight: 700;
207
- font-family: var(--cp-font-family-ui);
208
- }
209
-
210
- // Hover 效果
211
- &:hover {
212
- background: rgba(255, 255, 255, 0.05);
213
- }
214
- }
215
-
216
- // ===== 形状模式 (放在 variant 之后,确保 shape 优先级高于 variant) =====
217
- @include m(shape-clip) {
218
- $clip: var(--cp-tag-clip);
219
- clip-path: polygon(
220
- $clip 0,
221
- 100% 0,
222
- 100% calc(100% - #{$clip}),
223
- calc(100% - #{$clip}) 100%,
224
- 0 100%,
225
- 0 $clip
226
- );
227
- }
228
-
229
- @include m(shape-no-clip) {
230
- clip-path: none;
231
- border-radius: 2px;
232
-
233
- .cp-tag__decor {
234
- display: none;
235
- }
236
- }
237
-
238
- @include m(shape-round) {
239
- clip-path: none;
240
- border-radius: var(--cp-radius-lg);
241
-
242
- .cp-tag__decor {
243
- display: none;
244
- }
245
- }
246
-
247
- @include m(shape-circle) {
248
- clip-path: none;
249
- border-radius: 9999px;
250
-
251
- .cp-tag__decor {
252
- display: none;
253
- }
254
- }
255
-
256
- // ===== 前缀元素 =====
257
- @include e(prefix) {
258
- display: inline-flex;
259
- align-items: center;
260
- gap: 4px;
261
- margin-right: 4px;
262
- font-size: 1.1em;
263
- }
264
-
265
- // ===== 后缀元素 =====
266
- @include e(suffix) {
267
- display: inline-flex;
268
- align-items: center;
269
- margin-left: 4px;
270
- font-weight: 600;
271
- }
272
-
273
- // ===== 虚线边框 =====
274
- @include when(dashed) {
275
- border-style: dashed;
276
-
277
- // Note 变体: 只对左边框应用虚线
278
- &.cp-tag--variant-note {
279
- border-style: none;
280
- border-left-style: dashed;
281
- }
282
- }
283
-
284
- // ===== 可关闭状态 =====
285
- @include when(closable) {
286
- padding-right: 4px;
287
- }
288
-
289
- // ===== 禁用状态 =====
290
- @include when(disabled) {
291
- opacity: 0.5;
292
- cursor: not-allowed;
293
- filter: grayscale(0.6);
294
-
295
- .cp-tag__close {
296
- pointer-events: none;
297
- }
298
- }
299
-
300
- // ===== 可选中状态 (基础: 未选中) =====
301
- @include when(selectable) {
302
- cursor: pointer;
303
- user-select: none;
304
- transition: all 0.3s ease;
305
-
306
- // 未选中状态:降低饱和度和透明度,表现为"未激活"
307
- &:not(.is-selected) {
308
- filter: grayscale(0.6) opacity(0.75);
309
-
310
- &:hover {
311
- filter: grayscale(0.3) opacity(0.9);
312
- transform: translateY(-1px);
313
- }
314
- }
315
-
316
- &:active {
317
- transform: scale(0.96) translateY(0);
318
- }
319
- }
320
-
321
- // ===== 选中状态 (覆盖未选中样式) =====
322
- @include when(selected) {
323
- // 恢复原始色彩和全透明度
324
- filter: none;
325
- opacity: 1;
326
- z-index: 1;
327
-
328
- // 选中状态增强边框和发光效果
329
- box-shadow:
330
- 0 0 0 1px var(--cp-tag-color),
331
- 0 0 12px rgba(var(--cp-tag-color), 0.5);
332
-
333
- // Outline 变体选中时填充背景
334
- &.cp-tag--variant-outline {
335
- background: var(--cp-tag-color-light);
336
- }
337
-
338
- // Semi 变体选中时加深背景
339
- &.cp-tag--variant-semi {
340
- background: color-mix(in srgb, var(--cp-tag-color) 25%, transparent);
341
- border-color: var(--cp-tag-color);
342
- }
343
-
344
- // Note 变体选中时加亮背景
345
- &.cp-tag--variant-note {
346
- background: rgba(var(--cp-tag-color), 0.15);
347
- border-left-width: 3px;
348
- }
349
-
350
- // 选中状态的 Hover: 略微提亮
351
- &:hover {
352
- filter: brightness(1.1);
353
- transform: translateY(-1px);
354
- }
355
-
356
- // 点击动画 (取消选中时)
357
- &:active {
358
- transform: scale(0.96) translateY(0);
359
- }
360
- }
361
-
362
- // ===== 有 type 设置的标签 (is-typed) =====
363
- @include when(typed) {
364
- // Solid 变体: 大部分预设 type 颜色都是亮色,使用统一的深色文字变量
365
- &.cp-tag--variant-solid {
366
- color: var(--cp-text-on-bright);
367
-
368
- // 关闭按钮根据深色文字调整
369
- .cp-tag__close:hover {
370
- background: rgba(0, 0, 0, 0.15);
371
- }
372
- }
373
- }
374
-
375
- // ===== error 和 info 类型需要亮色文字 (背景色偏暗) =====
376
- &.cp-tag--type-error.cp-tag--variant-solid,
377
- &.cp-tag--type-info.cp-tag--variant-solid {
378
- color: var(--cp-text-on-dark);
379
-
380
- .cp-tag__close:hover {
381
- background: rgba(255, 255, 255, 0.2);
382
- }
383
- }
384
-
385
- // ===== Default 类型 (无 type、无 custom-color) =====
386
- &:not(.is-typed):not(.is-custom-color) {
387
- // 默认 solid 变体 - 使用 elevated 背景和 primary 文字 (与 Button 一致)
388
- &.cp-tag--variant-solid {
389
- --cp-tag-color: var(--cp-bg-elevated);
390
- background: var(--cp-bg-elevated);
391
- color: var(--cp-text-primary);
392
- border: 1px solid var(--cp-border);
393
-
394
- .cp-tag__decor {
395
- background: var(--cp-border);
396
- }
397
- }
398
-
399
- &.cp-tag--variant-outline,
400
- &.cp-tag--variant-semi {
401
- --cp-tag-color: var(--cp-text-secondary);
402
- --cp-tag-color-light: color-mix(in srgb, var(--cp-text-secondary) 10%, transparent);
403
- }
404
- }
405
-
406
- // Hover 效果
407
- &:not(.is-disabled) {
408
- &:hover {
409
- filter: brightness(1.1);
410
-
411
- .cp-tag__decor {
412
- opacity: 1;
413
- }
414
- }
415
- }
416
- }
1
+ // CpTag 组件样式
2
+ // 赛博朋克/机甲风格
3
+
4
+ @use "sass:map";
5
+ @use "../common/var" as *;
6
+ @use "../mixins/mixins" as *;
7
+
8
+ // Tag 尺寸配置
9
+ $tag-sizes: (
10
+ sm: (
11
+ height: 20px,
12
+ padding: 0 6px,
13
+ font-size: 11px,
14
+ clip: 4px,
15
+ close-size: 12px,
16
+ ),
17
+ md: (
18
+ height: 24px,
19
+ padding: 0 8px,
20
+ font-size: 12px,
21
+ clip: 5px,
22
+ close-size: 14px,
23
+ ),
24
+ lg: (
25
+ height: 28px,
26
+ padding: 0 10px,
27
+ font-size: 13px,
28
+ clip: 6px,
29
+ close-size: 16px,
30
+ ),
31
+ );
32
+
33
+ // 颜色映射
34
+ $tag-types: (
35
+ primary: var(--cp-color-primary),
36
+ success: var(--cp-color-success),
37
+ warning: var(--cp-color-warning),
38
+ error: var(--cp-color-error),
39
+ info: var(--cp-color-info),
40
+ );
41
+
42
+ @include b(tag) {
43
+ // 基础样式
44
+ position: relative;
45
+ display: inline-flex;
46
+ align-items: center;
47
+ justify-content: center;
48
+ box-sizing: border-box;
49
+ vertical-align: middle;
50
+ font-family: var(--cp-font-family-ui);
51
+ font-weight: 500;
52
+ white-space: nowrap;
53
+ user-select: none;
54
+ cursor: default;
55
+ transition: all 0.2s ease;
56
+
57
+ // CSS 变量默认值
58
+ --cp-tag-color: var(--cp-text-secondary);
59
+ --cp-tag-color-light: color-mix(in srgb, var(--cp-tag-color) 10%, transparent);
60
+ --cp-tag-bg: var(--cp-tag-color);
61
+ --cp-tag-border: var(--cp-tag-color);
62
+ --cp-tag-clip: 5px;
63
+ // 使用 color-contrast 自动选择最佳对比色 (黑或白)
64
+ --cp-tag-text: color-contrast(var(--cp-tag-color) vs #000, #fff);
65
+
66
+ // ===== 内容区域 =====
67
+ @include e(content) {
68
+ display: inline-flex;
69
+ align-items: center;
70
+ }
71
+
72
+ // ===== 关闭按钮 =====
73
+ @include e(close) {
74
+ display: inline-flex;
75
+ align-items: center;
76
+ justify-content: center;
77
+ margin-left: 4px;
78
+ cursor: pointer;
79
+ opacity: 0.7;
80
+ transition: all 0.15s ease;
81
+ border-radius: 2px;
82
+
83
+ svg {
84
+ width: 100%;
85
+ height: 100%;
86
+ }
87
+
88
+ &:hover {
89
+ opacity: 1;
90
+ background: rgba(255, 255, 255, 0.15);
91
+ }
92
+
93
+ &:active {
94
+ transform: scale(0.9);
95
+ }
96
+ }
97
+
98
+ // ===== 装饰块 (clip 模式右上角) =====
99
+ @include e(decor) {
100
+ position: absolute;
101
+ top: -1px;
102
+ right: -1px;
103
+ width: 5px;
104
+ height: 5px;
105
+ background: var(--cp-tag-color);
106
+ clip-path: polygon(0 0, 100% 0, 100% 100%);
107
+ opacity: 0.8;
108
+ pointer-events: none;
109
+ transition: opacity 0.2s ease;
110
+ }
111
+
112
+ // ===== 尺寸变体 =====
113
+ @each $size-name, $size-config in $tag-sizes {
114
+ @include m(#{$size-name}) {
115
+ height: map.get($size-config, height);
116
+ padding: map.get($size-config, padding);
117
+ font-size: map.get($size-config, font-size);
118
+ --cp-tag-clip: #{map.get($size-config, clip)};
119
+
120
+ .cp-tag__close {
121
+ width: map.get($size-config, close-size);
122
+ height: map.get($size-config, close-size);
123
+ }
124
+ }
125
+ }
126
+
127
+
128
+ // ===== 变体样式 =====
129
+ // Solid - 实心填充 (文字颜色由 is-typed / default 规则分别处理)
130
+ @include m(variant-solid) {
131
+ background: var(--cp-tag-color);
132
+ border: 1px solid transparent;
133
+
134
+ .cp-tag__decor {
135
+ background: rgba(255, 255, 255, 0.5);
136
+ }
137
+
138
+ // 关闭按钮 hover 背景
139
+ .cp-tag__close:hover {
140
+ background: rgba(0, 0, 0, 0.15);
141
+ }
142
+ }
143
+
144
+ // Outline - 边框描边
145
+ @include m(variant-outline) {
146
+ background: transparent;
147
+ color: var(--cp-tag-color);
148
+ border: 1px solid var(--cp-tag-color);
149
+
150
+ .cp-tag__decor {
151
+ background: var(--cp-tag-color);
152
+ }
153
+ }
154
+
155
+ // Semi - 半透明填充
156
+ @include m(variant-semi) {
157
+ background: var(--cp-tag-color-light);
158
+ color: var(--cp-tag-color);
159
+ border: 1px solid var(--cp-tag-color);
160
+ backdrop-filter: blur(4px);
161
+
162
+ .cp-tag__decor {
163
+ background: var(--cp-tag-color);
164
+ }
165
+ }
166
+
167
+ // Note - 便利贴风格 (左边框 + 半透明背景)
168
+ @include m(variant-note) {
169
+ background: rgba(0, 0, 0, 0.4);
170
+ color: var(--cp-tag-color);
171
+ border: none;
172
+ border-left: 2px solid var(--cp-tag-color);
173
+ border-radius: 0;
174
+ clip-path: none;
175
+ gap: 8px;
176
+ padding: 6px 12px;
177
+ height: auto;
178
+ min-height: 32px;
179
+
180
+ .cp-tag__decor {
181
+ display: none;
182
+ }
183
+
184
+ .cp-tag__prefix {
185
+ display: flex;
186
+ align-items: center;
187
+ gap: 4px;
188
+ font-size: 10px;
189
+ text-transform: uppercase;
190
+ letter-spacing: 0.05em;
191
+ opacity: 0.8;
192
+ }
193
+
194
+ .cp-tag__content {
195
+ display: flex;
196
+ align-items: center;
197
+ gap: 4px;
198
+ font-size: 10px;
199
+ text-transform: uppercase;
200
+ letter-spacing: 0.05em;
201
+ opacity: 0.8;
202
+ }
203
+
204
+ .cp-tag__suffix {
205
+ font-size: 18px;
206
+ font-weight: 700;
207
+ font-family: var(--cp-font-family-ui);
208
+ }
209
+
210
+ // Hover 效果
211
+ &:hover {
212
+ background: rgba(255, 255, 255, 0.05);
213
+ }
214
+ }
215
+
216
+ // ===== 形状模式 (放在 variant 之后,确保 shape 优先级高于 variant) =====
217
+ @include m(shape-clip) {
218
+ $clip: var(--cp-tag-clip);
219
+ clip-path: polygon(
220
+ $clip 0,
221
+ 100% 0,
222
+ 100% calc(100% - #{$clip}),
223
+ calc(100% - #{$clip}) 100%,
224
+ 0 100%,
225
+ 0 $clip
226
+ );
227
+ }
228
+
229
+ @include m(shape-no-clip) {
230
+ clip-path: none;
231
+ border-radius: 2px;
232
+
233
+ .cp-tag__decor {
234
+ display: none;
235
+ }
236
+ }
237
+
238
+ @include m(shape-round) {
239
+ clip-path: none;
240
+ border-radius: var(--cp-radius-lg);
241
+
242
+ .cp-tag__decor {
243
+ display: none;
244
+ }
245
+ }
246
+
247
+ @include m(shape-circle) {
248
+ clip-path: none;
249
+ border-radius: 9999px;
250
+
251
+ .cp-tag__decor {
252
+ display: none;
253
+ }
254
+ }
255
+
256
+ // ===== 前缀元素 =====
257
+ @include e(prefix) {
258
+ display: inline-flex;
259
+ align-items: center;
260
+ gap: 4px;
261
+ margin-right: 4px;
262
+ font-size: 1.1em;
263
+ }
264
+
265
+ // ===== 后缀元素 =====
266
+ @include e(suffix) {
267
+ display: inline-flex;
268
+ align-items: center;
269
+ margin-left: 4px;
270
+ font-weight: 600;
271
+ }
272
+
273
+ // ===== 虚线边框 =====
274
+ @include when(dashed) {
275
+ border-style: dashed;
276
+
277
+ // Note 变体: 只对左边框应用虚线
278
+ &.cp-tag--variant-note {
279
+ border-style: none;
280
+ border-left-style: dashed;
281
+ }
282
+ }
283
+
284
+ // ===== 可关闭状态 =====
285
+ @include when(closable) {
286
+ padding-right: 4px;
287
+ }
288
+
289
+ // ===== 禁用状态 =====
290
+ @include when(disabled) {
291
+ opacity: 0.5;
292
+ cursor: not-allowed;
293
+ filter: grayscale(0.6);
294
+
295
+ .cp-tag__close {
296
+ pointer-events: none;
297
+ }
298
+ }
299
+
300
+ // ===== 可选中状态 (基础: 未选中) =====
301
+ @include when(selectable) {
302
+ cursor: pointer;
303
+ user-select: none;
304
+ transition: all 0.3s ease;
305
+
306
+ // 未选中状态:降低饱和度和透明度,表现为"未激活"
307
+ &:not(.is-selected) {
308
+ filter: grayscale(0.6) opacity(0.75);
309
+
310
+ &:hover {
311
+ filter: grayscale(0.3) opacity(0.9);
312
+ transform: translateY(-1px);
313
+ }
314
+ }
315
+
316
+ &:active {
317
+ transform: scale(0.96) translateY(0);
318
+ }
319
+ }
320
+
321
+ // ===== 选中状态 (覆盖未选中样式) =====
322
+ @include when(selected) {
323
+ // 恢复原始色彩和全透明度
324
+ filter: none;
325
+ opacity: 1;
326
+ z-index: 1;
327
+
328
+ // 选中状态增强边框和发光效果
329
+ box-shadow:
330
+ 0 0 0 1px var(--cp-tag-color),
331
+ 0 0 12px rgba(var(--cp-tag-color), 0.5);
332
+
333
+ // Outline 变体选中时填充背景
334
+ &.cp-tag--variant-outline {
335
+ background: var(--cp-tag-color-light);
336
+ }
337
+
338
+ // Semi 变体选中时加深背景
339
+ &.cp-tag--variant-semi {
340
+ background: color-mix(in srgb, var(--cp-tag-color) 25%, transparent);
341
+ border-color: var(--cp-tag-color);
342
+ }
343
+
344
+ // Note 变体选中时加亮背景
345
+ &.cp-tag--variant-note {
346
+ background: rgba(var(--cp-tag-color), 0.15);
347
+ border-left-width: 3px;
348
+ }
349
+
350
+ // 选中状态的 Hover: 略微提亮
351
+ &:hover {
352
+ filter: brightness(1.1);
353
+ transform: translateY(-1px);
354
+ }
355
+
356
+ // 点击动画 (取消选中时)
357
+ &:active {
358
+ transform: scale(0.96) translateY(0);
359
+ }
360
+ }
361
+
362
+ // ===== 有 type 设置的标签 (is-typed) =====
363
+ @include when(typed) {
364
+ // Solid 变体: 大部分预设 type 颜色都是亮色,使用统一的深色文字变量
365
+ &.cp-tag--variant-solid {
366
+ color: var(--cp-text-on-bright);
367
+
368
+ // 关闭按钮根据深色文字调整
369
+ .cp-tag__close:hover {
370
+ background: rgba(0, 0, 0, 0.15);
371
+ }
372
+ }
373
+ }
374
+
375
+ // ===== error 和 info 类型需要亮色文字 (背景色偏暗) =====
376
+ &.cp-tag--type-error.cp-tag--variant-solid,
377
+ &.cp-tag--type-info.cp-tag--variant-solid {
378
+ color: var(--cp-text-on-dark);
379
+
380
+ .cp-tag__close:hover {
381
+ background: rgba(255, 255, 255, 0.2);
382
+ }
383
+ }
384
+
385
+ // ===== Default 类型 (无 type、无 custom-color) =====
386
+ &:not(.is-typed):not(.is-custom-color) {
387
+ // 默认 solid 变体 - 使用 elevated 背景和 primary 文字 (与 Button 一致)
388
+ &.cp-tag--variant-solid {
389
+ --cp-tag-color: var(--cp-bg-elevated);
390
+ background: var(--cp-bg-elevated);
391
+ color: var(--cp-text-primary);
392
+ border: 1px solid var(--cp-border);
393
+
394
+ .cp-tag__decor {
395
+ background: var(--cp-border);
396
+ }
397
+ }
398
+
399
+ &.cp-tag--variant-outline,
400
+ &.cp-tag--variant-semi {
401
+ --cp-tag-color: var(--cp-text-secondary);
402
+ --cp-tag-color-light: color-mix(in srgb, var(--cp-text-secondary) 10%, transparent);
403
+ }
404
+ }
405
+
406
+ // Hover 效果
407
+ &:not(.is-disabled) {
408
+ &:hover {
409
+ filter: brightness(1.1);
410
+
411
+ .cp-tag__decor {
412
+ opacity: 1;
413
+ }
414
+ }
415
+ }
416
+ }