@xihan-ui/styles 3.0.0 → 3.2.0
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/CHANGELOG.md +63 -0
- package/README.md +1 -1
- package/component-tokens.d.ts +29 -0
- package/components.tokens.json +683 -27
- package/css/alert.css +2 -2
- package/css/approval.css +4 -4
- package/css/button.css +9 -5
- package/css/calendar-picker.css +3 -3
- package/css/calendar-range-picker.css +7 -7
- package/css/carousel.css +45 -13
- package/css/cartesian-chart.css +11 -11
- package/css/cascader.css +10 -10
- package/css/citation.css +2 -2
- package/css/code-view.css +6 -6
- package/css/color-picker.css +81 -0
- package/css/color-swatch-picker.css +9 -4
- package/css/combobox.css +12 -4
- package/css/command.css +1 -1
- package/css/date-field.css +39 -0
- package/css/date-picker.css +86 -9
- package/css/date-range-picker.css +47 -7
- package/css/diff-view.css +8 -8
- package/css/field-array.css +1 -1
- package/css/field.css +4 -0
- package/css/file-upload.css +1 -1
- package/css/float-button.css +140 -27
- package/css/form.css +14 -6
- package/css/graph-chart.css +2 -2
- package/css/highlight.css +1 -1
- package/css/image.css +1 -1
- package/css/mention.css +1 -1
- package/css/message-feed.css +1 -1
- package/css/notification.css +26 -20
- package/css/number-field.css +18 -18
- package/css/page-header.css +2 -2
- package/css/password-input.css +2 -2
- package/css/popconfirm.css +3 -3
- package/css/question-flow.css +8 -8
- package/css/radar-chart.css +6 -6
- package/css/rating.css +1 -1
- package/css/select.css +2 -2
- package/css/separator.css +2 -2
- package/css/side-nav.css +13 -13
- package/css/skeleton.css +5 -5
- package/css/slider.css +6 -6
- package/css/sortable.css +2 -2
- package/css/table.css +19 -2
- package/css/tags-input.css +1 -1
- package/css/time-picker.css +59 -2
- package/css/tool-call.css +7 -7
- package/css/tooltip.css +1 -1
- package/css/tree-select.css +2 -2
- package/css/tree.css +81 -11
- package/dist/css/accordion.css +269 -0
- package/dist/css/affix.css +47 -0
- package/dist/css/alert.css +247 -0
- package/dist/css/anchor.css +252 -0
- package/dist/css/approval.css +501 -0
- package/dist/css/avatar-group.css +99 -0
- package/dist/css/avatar.css +98 -0
- package/dist/css/back-top.css +161 -0
- package/dist/css/badge.css +205 -0
- package/dist/css/bar-code.css +62 -0
- package/dist/css/breadcrumb.css +230 -0
- package/dist/css/button-group.css +263 -0
- package/dist/css/button.css +219 -0
- package/dist/css/calendar-picker.css +467 -0
- package/dist/css/calendar-range-picker.css +554 -0
- package/dist/css/card.css +221 -0
- package/dist/css/carousel.css +710 -0
- package/dist/css/cartesian-chart.css +830 -0
- package/dist/css/cascader.css +961 -0
- package/dist/css/checkbox-group.css +358 -0
- package/dist/css/checkbox.css +257 -0
- package/dist/css/citation.css +470 -0
- package/dist/css/clipboard.css +315 -0
- package/dist/css/code-view.css +374 -0
- package/dist/css/collapsible.css +185 -0
- package/dist/css/color-field.css +176 -0
- package/dist/css/color-picker.css +595 -0
- package/dist/css/color-slider.css +281 -0
- package/dist/css/color-swatch-picker.css +250 -0
- package/dist/css/color-swatch.css +35 -0
- package/dist/css/combobox.css +574 -0
- package/dist/css/command.css +399 -0
- package/dist/css/context-menu.css +420 -0
- package/dist/css/date-field.css +317 -0
- package/dist/css/date-picker.css +868 -0
- package/dist/css/date-range-picker.css +886 -0
- package/dist/css/description.css +67 -0
- package/dist/css/descriptions.css +299 -0
- package/dist/css/dialog.css +455 -0
- package/dist/css/diff-view.css +513 -0
- package/dist/css/download-trigger.css +151 -0
- package/dist/css/drawer.css +552 -0
- package/dist/css/editable.css +295 -0
- package/dist/css/empty-state.css +163 -0
- package/dist/css/field-array.css +226 -0
- package/dist/css/field.css +166 -0
- package/dist/css/fieldset.css +102 -0
- package/dist/css/file-upload.css +429 -0
- package/dist/css/flex.css +441 -0
- package/dist/css/float-button.css +569 -0
- package/dist/css/floating-panel.css +429 -0
- package/dist/css/focus.css +46 -0
- package/dist/css/forced-colors.css +93 -0
- package/dist/css/form.css +393 -0
- package/dist/css/funnel-chart.css +106 -0
- package/dist/css/graph-chart.css +205 -0
- package/dist/css/grid-list.css +235 -0
- package/dist/css/grid.css +1201 -0
- package/dist/css/heatmap.css +552 -0
- package/dist/css/hierarchy-chart.css +298 -0
- package/dist/css/highlight.css +41 -0
- package/dist/css/hover-card.css +226 -0
- package/dist/css/icon.css +225 -0
- package/dist/css/image-cropper.css +373 -0
- package/dist/css/image-viewer.css +538 -0
- package/dist/css/image.css +98 -0
- package/dist/css/infinite-scroll.css +77 -0
- package/dist/css/input-group.css +275 -0
- package/dist/css/json-viewer.css +379 -0
- package/dist/css/kbd.css +72 -0
- package/dist/css/label.css +78 -0
- package/dist/css/layers.css +7 -0
- package/dist/css/layout.css +372 -0
- package/dist/css/liquid.css +106 -0
- package/dist/css/list.css +152 -0
- package/dist/css/listbox.css +390 -0
- package/dist/css/loading-bar.css +141 -0
- package/dist/css/log.css +306 -0
- package/dist/css/markdown-stream.css +149 -0
- package/dist/css/marquee.css +378 -0
- package/dist/css/masonry.css +70 -0
- package/dist/css/matrix-code.css +67 -0
- package/dist/css/mention.css +393 -0
- package/dist/css/menu.css +364 -0
- package/dist/css/menubar.css +456 -0
- package/dist/css/message-feed.css +318 -0
- package/dist/css/navigation-menu.css +513 -0
- package/dist/css/notification.css +782 -0
- package/dist/css/number-animation.css +44 -0
- package/dist/css/number-field.css +252 -0
- package/dist/css/overlay-arrow.css +56 -0
- package/dist/css/page-header.css +184 -0
- package/dist/css/pagination.css +450 -0
- package/dist/css/password-input.css +391 -0
- package/dist/css/pie-chart.css +247 -0
- package/dist/css/pin-input.css +199 -0
- package/dist/css/pointer.css +36 -0
- package/dist/css/popconfirm.css +320 -0
- package/dist/css/popover.css +279 -0
- package/dist/css/progress.css +501 -0
- package/dist/css/prompt-input.css +260 -0
- package/dist/css/question-flow.css +553 -0
- package/dist/css/radar-chart.css +233 -0
- package/dist/css/radio-group.css +598 -0
- package/dist/css/rating.css +294 -0
- package/dist/css/reasoning.css +343 -0
- package/dist/css/reset.css +117 -0
- package/dist/css/resizable.css +242 -0
- package/dist/css/sankey-chart.css +174 -0
- package/dist/css/scroll-area.css +240 -0
- package/dist/css/scrollbar.css +204 -0
- package/dist/css/select.css +612 -0
- package/dist/css/separator.css +122 -0
- package/dist/css/side-nav.css +476 -0
- package/dist/css/signature-pad.css +179 -0
- package/dist/css/skeleton.css +161 -0
- package/dist/css/slider.css +374 -0
- package/dist/css/sortable.css +228 -0
- package/dist/css/sparkline.css +164 -0
- package/dist/css/spinner.css +236 -0
- package/dist/css/splitter.css +159 -0
- package/dist/css/statistic.css +137 -0
- package/dist/css/steps.css +627 -0
- package/dist/css/switch.css +351 -0
- package/dist/css/table.css +1145 -0
- package/dist/css/tabs.css +944 -0
- package/dist/css/tag-group.css +247 -0
- package/dist/css/tag.css +310 -0
- package/dist/css/tags-input.css +322 -0
- package/dist/css/text-field.css +197 -0
- package/dist/css/time-field.css +277 -0
- package/dist/css/time-picker.css +707 -0
- package/dist/css/time-range-picker.css +746 -0
- package/dist/css/timeline.css +423 -0
- package/dist/css/timer.css +123 -0
- package/dist/css/timestamp.css +34 -0
- package/dist/css/toggle-group.css +424 -0
- package/dist/css/toggle.css +146 -0
- package/dist/css/tone.css +189 -0
- package/dist/css/tool-call.css +429 -0
- package/dist/css/toolbar.css +365 -0
- package/dist/css/tooltip.css +218 -0
- package/dist/css/tour.css +439 -0
- package/dist/css/transfer.css +638 -0
- package/dist/css/tree-select.css +878 -0
- package/dist/css/tree.css +733 -0
- package/dist/css/truncate.css +108 -0
- package/dist/css/typography.css +472 -0
- package/dist/css/undefined.css +58 -0
- package/dist/css/virtualizer.css +166 -0
- package/dist/css/visually-hidden.css +20 -0
- package/dist/css/watermark.css +82 -0
- package/dist/family/action-control.css +487 -0
- package/dist/family/chart.css +480 -0
- package/dist/family/check-mark.css +94 -0
- package/dist/family/choice-card.css +97 -0
- package/dist/family/collection-item.css +764 -0
- package/dist/family/field-chrome.css +287 -0
- package/dist/family/loading-ring.css +95 -0
- package/dist/family/material.css +72 -0
- package/dist/family/menu-choice.css +56 -0
- package/dist/family/motion.css +363 -0
- package/dist/family/swatch.css +59 -0
- package/dist/family/tag-list.css +59 -0
- package/family/action-control.css +3 -12
- package/index.css +7307 -6759
- package/index.unlayered.css +7309 -6761
- package/package.json +165 -164
|
@@ -0,0 +1,627 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-Present XiHanFun and contributors.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* 定义 steps 样式。 */
|
|
7
|
+
|
|
8
|
+
@import '../family/action-control.css';
|
|
9
|
+
/* 走过那一步时对号的淡入取共享关键帧。 */
|
|
10
|
+
@import '../family/motion.css';
|
|
11
|
+
|
|
12
|
+
/* 当前步的完成比例(0–1)由连接层写进圆点的内联样式。登记成数值,进度环的弧才能沿过渡走到新比例;
|
|
13
|
+
要继承:画弧的是圆点的 ::after。不认 @property 的引擎把它当普通自定义属性,弧照旧落到新比例,只是没有过渡 */
|
|
14
|
+
@property --xh-_steps-progress {
|
|
15
|
+
syntax: '<number>';
|
|
16
|
+
inherits: true;
|
|
17
|
+
initial-value: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@layer xihan.components {
|
|
21
|
+
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
22
|
+
.xh-scope-steps {
|
|
23
|
+
--xh-steps-skin: 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.xh-scope-steps[data-part='root'] {
|
|
27
|
+
/* 作者放进标题 / 说明里的图标是控件内图标,随尺寸档取 glyph-size-sm / md / lg,缺省 md;
|
|
28
|
+
每一档都把 --xh-steps-icon-size 排在档值前面,外层统一改尺的通道不被档值挡住。
|
|
29
|
+
走过的步里皮肤画的兜底对号不读这支:它是指示符,与序号圆点同走 --xh-control-indicator-* 一族——
|
|
30
|
+
圆点在自己身上把 --xh-icon-size 改接到 --xh-steps-indicator-mark-size,兜底对号与作者塞进圆点里的
|
|
31
|
+
XhIcon 读同一把尺 */
|
|
32
|
+
--xh-icon-size: var(--xh-steps-icon-size, var(--xh-glyph-size-md));
|
|
33
|
+
|
|
34
|
+
/* 尺寸档只换这三个私有槽,序号圆点、标题与圆点里的序号都从 root 继承它们,
|
|
35
|
+
换档不必给每个部件各写一条选择器;说明走说明角色(13px),不随档。
|
|
36
|
+
圆点与 Avatar、带框 Icon 同一把尺:control-h 的 sm / md / lg,随密度换档 */
|
|
37
|
+
--xh-_steps-indicator-size: var(--xh-control-h-md);
|
|
38
|
+
--xh-_steps-title-font-size: var(--xh-control-font-md);
|
|
39
|
+
--xh-_steps-caption-font-size: var(--xh-text-caption-size);
|
|
40
|
+
/* 圆点一圈边的宽:序号圆点是细边(多数状态透明占位),点状形态的空心圈要粗一档才读得出是个圈 */
|
|
41
|
+
--xh-_steps-indicator-border-width: var(--xh-stroke-thin);
|
|
42
|
+
/* 圆点四周给当前步那圈环留的位置:序号圆点不留,点状形态留出环的宽度,换步不挪版面 */
|
|
43
|
+
--xh-_steps-indicator-margin: var(--xh-space-0);
|
|
44
|
+
/* 当前步那圈环:离圆点边一道缝,环本身一道粗描边宽 */
|
|
45
|
+
--xh-_steps-ring-gap: var(--xh-space-0_5);
|
|
46
|
+
--xh-_steps-ring-thickness: var(--xh-stroke-thick);
|
|
47
|
+
|
|
48
|
+
/* 语气落在当前步的标记、走过那几步的对号与连接线上:强调色画描边与填充,
|
|
49
|
+
accent-text 是普通底上的强调文字(走过与当前步的标题),on-accent 是实心底上的前景。
|
|
50
|
+
没写 data-tone 时 --xh-_tone 一族没被声明,三个槽都退回原来的品牌配色。
|
|
51
|
+
走过的步不再用品牌淡底(brand-subtle 退出 completed 语义),淡底那两支私有槽随之撤掉 */
|
|
52
|
+
--xh-_steps-accent: var(--xh-_tone, var(--xh-bg-brand));
|
|
53
|
+
--xh-_steps-accent-text: var(--xh-_tone-fg, var(--xh-fg-brand-strong));
|
|
54
|
+
/* 走过的步里那枚对号:中性淡底上的品牌色标记,不用标题那档更深的字色 */
|
|
55
|
+
--xh-_steps-accent-mark: var(--xh-_tone-fg, var(--xh-fg-brand));
|
|
56
|
+
--xh-_steps-on-accent: var(--xh-_tone-on, var(--xh-fg-on-brand));
|
|
57
|
+
/* 触发器是序号圆点的承载面:圆点静息就坐在 --xh-bg-subtle(100)的淡底上,阶梯按淡底容器走
|
|
58
|
+
(hover 200 → pressed 300)。两支私有槽是这一档的唯一来源——触发器拿它们给
|
|
59
|
+
--xh-action-host-bg-* 赋值(桥接槽只写不读),圆点悬停 / 按下读同一支私有槽,即与宿主的 host 槽同源 */
|
|
60
|
+
--xh-_steps-host-bg-hover: var(--xh-bg-subtle-hover);
|
|
61
|
+
--xh-_steps-host-bg-pressed: var(--xh-bg-subtle-active);
|
|
62
|
+
/* 走过的那几步是实心圆,顶边画一条极浅的内高光把它衬出厚度 */
|
|
63
|
+
--xh-_steps-highlight: inset 0 var(--xh-stroke-thin) 0 0
|
|
64
|
+
color-mix(in oklab, var(--xh-_steps-on-accent) 14%, transparent);
|
|
65
|
+
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
gap: var(--xh-steps-gap, var(--xh-stack-gap-md));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.xh-scope-steps[data-part='root'][hidden] {
|
|
72
|
+
display: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* 纵向:步骤列与面板并排;两栏一起放不下时面板换到下一行,步骤列因此拿得回整行宽度 */
|
|
76
|
+
.xh-scope-steps[data-part='root'][data-orientation='vertical'] {
|
|
77
|
+
flex-direction: row;
|
|
78
|
+
flex-wrap: wrap;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* 面板的换行基准:一行正文的宽度。步骤列的内容宽加上这一格放不下,两者就分成两行 */
|
|
82
|
+
.xh-scope-steps[data-part='root'][data-orientation='vertical'] > .xh-scope-steps[data-part='content'] {
|
|
83
|
+
flex: 1 1 var(--xh-steps-content-min-inline-size, var(--xh-measure-prose));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* —— 尺寸 —— */
|
|
87
|
+
/* 缺省档写在上面的基础规则里 */
|
|
88
|
+
.xh-scope-steps[data-part='root'][data-size='sm'] {
|
|
89
|
+
--xh-icon-size: var(--xh-steps-icon-size, var(--xh-glyph-size-sm));
|
|
90
|
+
--xh-_steps-indicator-size: var(--xh-control-h-sm);
|
|
91
|
+
--xh-_steps-title-font-size: var(--xh-control-font-sm);
|
|
92
|
+
/* 字号档最小就是 xs,序号不再往下走,故不重声明 caption */
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.xh-scope-steps[data-part='root'][data-size='lg'] {
|
|
96
|
+
--xh-icon-size: var(--xh-steps-icon-size, var(--xh-glyph-size-lg));
|
|
97
|
+
--xh-_steps-indicator-size: var(--xh-control-h-lg);
|
|
98
|
+
--xh-_steps-title-font-size: var(--xh-control-font-lg);
|
|
99
|
+
--xh-_steps-caption-font-size: var(--xh-text-secondary-size);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* —— 点状形态 —— */
|
|
103
|
+
/* 圆点不盛内容,是纯位置标记:直径不在控件高度那把尺上,与 Timeline 圆点同走空间尺相邻的三格,
|
|
104
|
+
不随密度换档;描边粗一档,四周留出当前步那圈环的宽度 */
|
|
105
|
+
.xh-scope-steps[data-part='root'][data-variant='dot'] {
|
|
106
|
+
--xh-_steps-indicator-size: var(--xh-space-2_5);
|
|
107
|
+
--xh-_steps-indicator-border-width: var(--xh-stroke-thick);
|
|
108
|
+
--xh-_steps-indicator-margin: calc(var(--xh-_steps-ring-gap) + var(--xh-_steps-ring-thickness));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.xh-scope-steps[data-part='root'][data-variant='dot'][data-size='sm'] {
|
|
112
|
+
--xh-_steps-indicator-size: var(--xh-space-2);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.xh-scope-steps[data-part='root'][data-variant='dot'][data-size='lg'] {
|
|
116
|
+
--xh-_steps-indicator-size: var(--xh-space-3);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* 步骤与连接线必须保持在同一条流程轴上,空间不足时由标题省略而不是拆成两行。 */
|
|
120
|
+
.xh-scope-steps[data-part='list'] {
|
|
121
|
+
display: flex;
|
|
122
|
+
flex-wrap: nowrap;
|
|
123
|
+
align-items: flex-start;
|
|
124
|
+
gap: var(--xh-steps-list-gap, var(--xh-space-0));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.xh-scope-steps[data-part='list'][hidden] {
|
|
128
|
+
display: none;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* 竖排时列被拉到与面板同高,那是一个确定的块向尺寸;折行在这里会把步骤摊成两列,
|
|
132
|
+
所以这一档明确关掉 */
|
|
133
|
+
.xh-scope-steps[data-part='list'][data-orientation='vertical'] {
|
|
134
|
+
flex-direction: column;
|
|
135
|
+
flex-wrap: nowrap;
|
|
136
|
+
align-items: stretch;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* 每一步与它后面那截连接线一起占一格,等分整行;min-inline-size 允许被压缩,
|
|
140
|
+
标题里的省略号才有生效的余地 */
|
|
141
|
+
.xh-scope-steps[data-part='item'] {
|
|
142
|
+
display: flex;
|
|
143
|
+
flex: 1;
|
|
144
|
+
align-items: center;
|
|
145
|
+
gap: var(--xh-steps-item-gap, var(--xh-space-2));
|
|
146
|
+
min-inline-size: 0;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.xh-scope-steps[data-part='item'][hidden] {
|
|
150
|
+
display: none;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* 末步后面没有"下一步",那截连接线不该占地方;作者不写它也一样,写了就替他收掉。
|
|
154
|
+
末步按内容宽摆、不参与伸缩,标题长过整行时由 100% 收住,超出的部分走省略号 */
|
|
155
|
+
.xh-scope-steps[data-part='item']:last-child {
|
|
156
|
+
flex: none;
|
|
157
|
+
max-inline-size: 100%;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.xh-scope-steps[data-part='item']:last-child .xh-scope-steps[data-part='separator'] {
|
|
161
|
+
display: none;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* 横排始终留在同一条轴上,标题与说明负责在自己的格内省略。 */
|
|
165
|
+
.xh-scope-steps[data-part='item'][data-orientation='horizontal']:not(:last-child) {
|
|
166
|
+
min-inline-size: var(--xh-steps-item-min-inline-size, var(--xh-space-0));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.xh-scope-steps[data-part='item'][data-orientation='vertical'] {
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
flex: none;
|
|
172
|
+
align-items: flex-start;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* 触发器是「序号 + 标题 + 说明」的整块内容行:接 Action Control row 档、ghost 形态,悬停 / 按下 / 禁用面、
|
|
176
|
+
手型、过渡与焦点环由家族给,按下只换面不缩放(row 档专属按压块 scale: none);这里只把使用者槽映射到桥接槽。
|
|
177
|
+
触发器既是 Action Control 又是圆点的承载面:自己坐画布走 hover 100 → pressed 200,由 --xh-action-bg-* 钉住;
|
|
178
|
+
--xh-action-host-bg-* 只对圆点生效(圆点自己是 100 的淡底,坐在触发器面上再上一档到 200 / 300)。
|
|
179
|
+
排成两列:序号占左列并跨两行,标题与说明各占右列一行。用 grid 而不是再包一层节点——解剖里没有那个包裹层,
|
|
180
|
+
作者也不该被逼着多写一个 div;只有说明缺席时右列的第二行是零高,不会留白 */
|
|
181
|
+
.xh-scope-steps[data-part='trigger'] {
|
|
182
|
+
/* 纵向留一圈给悬停底色与焦点环,横向走控件内边距尺的小档;一个槽同时盖住两轴 */
|
|
183
|
+
--xh-action-padding-block: var(--xh-steps-trigger-p, var(--xh-space-1));
|
|
184
|
+
--xh-action-padding-inline: var(--xh-steps-trigger-p, var(--xh-control-px-sm));
|
|
185
|
+
--xh-action-radius: var(--xh-steps-trigger-radius, var(--xh-shape-control));
|
|
186
|
+
/* 列距仍由 column-gap 给:家族的 gap 会连 row-gap 一起把标题与说明撑开 */
|
|
187
|
+
--xh-action-gap: 0;
|
|
188
|
+
/* 高度由圆点 + 内距决定,不取 control-h 地板 */
|
|
189
|
+
--xh-action-visual-size: 0;
|
|
190
|
+
--xh-action-font-size: inherit;
|
|
191
|
+
/* 标题 / 说明 / 圆点各自着色,行本身不定字色 */
|
|
192
|
+
--xh-action-fg-rest: currentColor;
|
|
193
|
+
--xh-action-fg-hover: currentColor;
|
|
194
|
+
--xh-action-fg-pressed: currentColor;
|
|
195
|
+
--xh-action-fg-focus-visible: currentColor;
|
|
196
|
+
--xh-action-fg-disabled: currentColor;
|
|
197
|
+
--xh-action-bg-hover: var(--xh-steps-trigger-bg-hover, var(--xh-bg-subtle));
|
|
198
|
+
--xh-action-bg-pressed: var(--xh-steps-trigger-bg-pressed, var(--xh-bg-subtle-hover));
|
|
199
|
+
--xh-action-host-bg-hover: var(--xh-_steps-host-bg-hover);
|
|
200
|
+
--xh-action-host-bg-pressed: var(--xh-_steps-host-bg-pressed);
|
|
201
|
+
|
|
202
|
+
/* 皮肤规则排在 @import 之后,同特指度盖过 row 档的 display: flex */
|
|
203
|
+
display: grid;
|
|
204
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
205
|
+
align-items: center;
|
|
206
|
+
column-gap: var(--xh-steps-trigger-gap, var(--xh-control-gap-md));
|
|
207
|
+
/* row 档铺满容器(inline-size: 100%)会把横排的连接线压到最小长度 */
|
|
208
|
+
inline-size: auto;
|
|
209
|
+
/* 纵向连接线的 margin-inline-start 按圆点半径 + trigger-p 对齐圆心,ghost 的 1px 透明边位会让它错 1px */
|
|
210
|
+
border-width: 0;
|
|
211
|
+
font: inherit;
|
|
212
|
+
text-align: start;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* 只读展示:trigger 不投影 Action Control,只是「序号 + 标题 + 说明」的排版容器——内距与可操作时同一把尺,
|
|
216
|
+
在两种形态间切换版面不跳;没有悬停、按压与焦点环,标题与说明不置灰 */
|
|
217
|
+
.xh-scope-steps[data-part='trigger'][data-readonly] {
|
|
218
|
+
padding-block: var(--xh-steps-trigger-p, var(--xh-space-1));
|
|
219
|
+
padding-inline: var(--xh-steps-trigger-p, var(--xh-control-px-sm));
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.xh-scope-steps[data-part='trigger'][hidden] {
|
|
223
|
+
display: none;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.xh-scope-steps[data-part='item'][data-disabled] .xh-scope-steps[data-part='title'],
|
|
227
|
+
.xh-scope-steps[data-part='item'][data-disabled] .xh-scope-steps[data-part='description'] {
|
|
228
|
+
color: var(--xh-fg-disabled);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* 序号圆点:未开始使用中性面,当前步骤实心强调,已完成步骤中性面上画品牌对号。 */
|
|
232
|
+
.xh-scope-steps[data-part='indicator'] {
|
|
233
|
+
/* 圆点里的字形是指示符:对号按指示符档取尺、随密度换档(comfortable 16 / compact 14),
|
|
234
|
+
不读 root 上只管作者标题 / 说明图标的 --xh-steps-icon-size;作者塞进圆点的 XhIcon 与兜底对号同一把尺。
|
|
235
|
+
圆点自己走 control-h 的尺(最小 compact sm 的 28px),两档字形在三档圆点里都留得出边距 */
|
|
236
|
+
--xh-icon-size: var(--xh-steps-indicator-mark-size, var(--xh-control-indicator-size));
|
|
237
|
+
|
|
238
|
+
/* 当前步那圈环(::after)以圆点为准绳定位 */
|
|
239
|
+
position: relative;
|
|
240
|
+
display: inline-flex;
|
|
241
|
+
grid-row: 1 / span 2;
|
|
242
|
+
flex: none;
|
|
243
|
+
align-items: center;
|
|
244
|
+
justify-content: center;
|
|
245
|
+
inline-size: var(--xh-steps-indicator-size, var(--xh-_steps-indicator-size));
|
|
246
|
+
block-size: var(--xh-steps-indicator-size, var(--xh-_steps-indicator-size));
|
|
247
|
+
border: var(--xh-_steps-indicator-border-width) solid var(--xh-steps-indicator-border, transparent);
|
|
248
|
+
border-radius: var(--xh-steps-indicator-radius, var(--xh-shape-circle));
|
|
249
|
+
background: var(--xh-steps-indicator-bg, var(--xh-bg-subtle));
|
|
250
|
+
color: var(--xh-steps-indicator-fg, var(--xh-fg-muted));
|
|
251
|
+
font-size: var(--xh-steps-indicator-font-size, var(--xh-_steps-caption-font-size));
|
|
252
|
+
font-weight: var(--xh-font-weight-medium);
|
|
253
|
+
/* 等宽数字:1 与 7 的字形宽度在比例字体里并不相同,不定住会让序号左右抖一格 */
|
|
254
|
+
font-variant-numeric: tabular-nums;
|
|
255
|
+
line-height: var(--xh-leading-none);
|
|
256
|
+
transition:
|
|
257
|
+
background-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
258
|
+
border-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
259
|
+
box-shadow var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
260
|
+
color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.xh-scope-steps[data-part='indicator'][hidden] {
|
|
264
|
+
display: none;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/* 圆点是格状当前的标记,但不是激活宿主:宿主是投影了 row 档的触发器;圆点在宿主的
|
|
268
|
+
:hover / :is(:active, [data-pressed]) 下读宿主 host 槽的同一来源换面,同一时间线,不缩放——
|
|
269
|
+
圆点自己是 100 的淡底,坐在触发器的 hover 面(100)上,再上一档到 200 才与承载面分得开,按下到 300;
|
|
270
|
+
当前步的实心面按下换语气 active 档 */
|
|
271
|
+
.xh-scope-steps[data-part='trigger']:hover:not([data-disabled], [data-readonly])
|
|
272
|
+
.xh-scope-steps[data-part='indicator'][data-state='incomplete'] {
|
|
273
|
+
background: var(--xh-steps-indicator-bg-hover, var(--xh-_steps-host-bg-hover));
|
|
274
|
+
color: var(--xh-steps-indicator-fg-hover, var(--xh-fg-default));
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/* 点状形态里走过的点是实心标记色,悬停不换成中性面:承载它的行换面即是悬停反馈 */
|
|
278
|
+
.xh-scope-steps[data-part='trigger']:hover:not([data-disabled], [data-readonly])
|
|
279
|
+
.xh-scope-steps[data-part='indicator'][data-state='completed']:not([data-variant='dot']) {
|
|
280
|
+
background: var(--xh-steps-indicator-bg-completed-hover, var(--xh-_steps-host-bg-hover));
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.xh-scope-steps[data-part='trigger']:not([data-disabled], [data-readonly]):is(:active, [data-pressed])
|
|
284
|
+
.xh-scope-steps[data-part='indicator']:is([data-state='incomplete'], [data-state='completed']:not([data-variant='dot'])) {
|
|
285
|
+
background: var(--xh-steps-indicator-bg-pressed, var(--xh-_steps-host-bg-pressed));
|
|
286
|
+
transition-duration: var(--xh-motion-duration-press);
|
|
287
|
+
transition-timing-function: var(--xh-motion-ease-press);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.xh-scope-steps[data-part='trigger']:not([data-disabled], [data-readonly]):is(:active, [data-pressed])
|
|
291
|
+
.xh-scope-steps[data-part='indicator'][data-state='current']:not([data-variant='dot']) {
|
|
292
|
+
background: var(--xh-steps-indicator-bg-current-pressed, var(--xh-_tone-active, var(--xh-bg-brand-active)));
|
|
293
|
+
transition-duration: var(--xh-motion-duration-press);
|
|
294
|
+
transition-timing-function: var(--xh-motion-ease-press);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.xh-scope-steps[data-part='indicator'][data-state='current'] {
|
|
298
|
+
border-color: var(--xh-steps-indicator-border-current, var(--xh-_steps-accent));
|
|
299
|
+
background: var(--xh-steps-indicator-bg-current, var(--xh-_steps-accent));
|
|
300
|
+
color: var(--xh-steps-indicator-fg-current, var(--xh-_steps-on-accent));
|
|
301
|
+
box-shadow: var(--xh-steps-indicator-shadow, var(--xh-_steps-highlight));
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/* 走过的步:中性淡底(透明边位)承一枚品牌色对号;标了语气的步对号跟语气的前景走 */
|
|
305
|
+
.xh-scope-steps[data-part='indicator'][data-state='completed'] {
|
|
306
|
+
border-color: var(--xh-steps-indicator-border-completed, transparent);
|
|
307
|
+
background: var(--xh-steps-indicator-bg-completed, var(--xh-bg-subtle));
|
|
308
|
+
color: var(--xh-steps-indicator-fg-completed, var(--xh-_steps-accent-mark));
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/* 点状形态的三态:没走到的空心粗圈(墨色与序号形态的序号同一支),走过的实心标记色(序号形态里那枚对号的颜色),
|
|
312
|
+
当前步实心品牌(格状当前)外加一圈同色环。空心 / 实心 / 带环是形状通道,不只靠颜色分三态;
|
|
313
|
+
四周留出环的宽度,换步时版面不挪 */
|
|
314
|
+
.xh-scope-steps[data-part='indicator'][data-variant='dot'] {
|
|
315
|
+
margin: var(--xh-_steps-indicator-margin);
|
|
316
|
+
border-color: var(--xh-steps-indicator-border, var(--xh-fg-muted));
|
|
317
|
+
background: var(--xh-steps-indicator-bg, transparent);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/* 实心的点底与圈同一色,取自 --xh-_steps-dot:走过的标记色、当前步品牌,按下换语气 active 档
|
|
321
|
+
(与序号圆点当前步按下同一档),动不了的禁用墨色。小圆点上画不下实心那档的内高光 */
|
|
322
|
+
.xh-scope-steps[data-part='indicator'][data-variant='dot'][data-state='completed'] {
|
|
323
|
+
--xh-_steps-dot: var(--xh-steps-indicator-bg-completed, var(--xh-_steps-accent-mark));
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.xh-scope-steps[data-part='indicator'][data-variant='dot'][data-state='current'] {
|
|
327
|
+
--xh-_steps-dot: var(--xh-steps-indicator-bg-current, var(--xh-_steps-accent));
|
|
328
|
+
|
|
329
|
+
box-shadow: none;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.xh-scope-steps[data-part='trigger']:not([data-disabled], [data-readonly]):is(:active, [data-pressed])
|
|
333
|
+
.xh-scope-steps[data-part='indicator'][data-variant='dot'] {
|
|
334
|
+
--xh-_steps-dot: var(--xh-steps-indicator-bg-current-pressed, var(--xh-_tone-active, var(--xh-bg-brand-active)));
|
|
335
|
+
|
|
336
|
+
transition-duration: var(--xh-motion-duration-press);
|
|
337
|
+
transition-timing-function: var(--xh-motion-ease-press);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/* 动不了的那几步形状不变、墨色退到禁用档:空心的仍是空心。排在单步语气之前、与它同特指度:
|
|
341
|
+
标了语气又被锁住的那一步与序号形态一样按语气画 */
|
|
342
|
+
.xh-scope-steps[data-part='item'][data-disabled] .xh-scope-steps[data-part='indicator'][data-variant='dot'] {
|
|
343
|
+
--xh-_steps-dot: var(--xh-steps-indicator-bg-disabled, var(--xh-fg-disabled));
|
|
344
|
+
|
|
345
|
+
border-color: var(--xh-steps-indicator-border-disabled, var(--xh-fg-disabled));
|
|
346
|
+
background: transparent;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/* 带上触发器这一层祖先:特指度才压得过上面与下面两条禁用块铺的底 */
|
|
350
|
+
.xh-scope-steps[data-part='trigger'] .xh-scope-steps[data-part='indicator'][data-variant='dot']:not([data-state='incomplete']) {
|
|
351
|
+
border-color: var(--xh-_steps-dot);
|
|
352
|
+
background: var(--xh-_steps-dot);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/* 当前步那圈环:离圆点边一道缝、一道粗描边宽,叠在圆点外面、不接指针;环面由一圈角向渐变经环形遮罩挖空中心得来。
|
|
356
|
+
弧(arc)从 12 点顺时针走到完成比例,其余是轨道(track):点状形态不带比例,轨道与弧同色,就是整圈实心环;
|
|
357
|
+
序号圆点带了比例(data-progress),轨道取连接线的底色,弧就是这一步走了多少。时钟式的走向是稳定身份,不随书写方向镜像。
|
|
358
|
+
静息收着,点状形态的当前步与带比例的当前步才亮出来,走到 / 离开这一步时按状态角色淡入淡出;
|
|
359
|
+
比例变化时弧按数值角色走(move / continuous),首帧直接落位 */
|
|
360
|
+
.xh-scope-steps[data-part='indicator']::after {
|
|
361
|
+
--xh-_steps-ring-arc: var(--xh-steps-indicator-ring-bg, var(--xh-_steps-accent));
|
|
362
|
+
--xh-_steps-ring-track: var(--xh-_steps-ring-arc);
|
|
363
|
+
|
|
364
|
+
content: '';
|
|
365
|
+
position: absolute;
|
|
366
|
+
inset: calc(-1 * (var(--xh-_steps-indicator-border-width) + var(--xh-_steps-ring-gap) + var(--xh-_steps-ring-thickness)));
|
|
367
|
+
border-radius: inherit;
|
|
368
|
+
background: conic-gradient(
|
|
369
|
+
var(--xh-_steps-ring-arc) calc(var(--xh-_steps-progress) * 100%),
|
|
370
|
+
var(--xh-_steps-ring-track) 0%
|
|
371
|
+
);
|
|
372
|
+
-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--xh-_steps-ring-thickness)), currentColor 0);
|
|
373
|
+
mask: radial-gradient(farthest-side, transparent calc(100% - var(--xh-_steps-ring-thickness)), currentColor 0);
|
|
374
|
+
opacity: 0;
|
|
375
|
+
pointer-events: none;
|
|
376
|
+
transition:
|
|
377
|
+
opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
378
|
+
--xh-_steps-progress var(--xh-motion-duration-move) var(--xh-motion-ease-continuous);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.xh-scope-steps[data-part='indicator'][data-state='current']:is([data-variant='dot'], [data-progress])::after {
|
|
382
|
+
opacity: 1;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.xh-scope-steps[data-part='indicator'][data-progress]::after {
|
|
386
|
+
--xh-_steps-ring-track: var(--xh-steps-indicator-ring-track, var(--xh-border-default));
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.xh-scope-steps[data-part='item'][data-disabled] .xh-scope-steps[data-part='indicator']::after {
|
|
390
|
+
--xh-_steps-ring-arc: var(--xh-steps-indicator-ring-bg-disabled, var(--xh-fg-disabled));
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/* 单步语气:tones / collection 给某一步标了 data-tone,四个强调槽在这一步重新从语气层取值,
|
|
394
|
+
它的标记、标题与连接线照旧从祖先继承——只有这一步换色,状态那一档照算 */
|
|
395
|
+
.xh-scope-steps[data-part='item'][data-tone] {
|
|
396
|
+
--xh-_steps-accent: var(--xh-_tone);
|
|
397
|
+
--xh-_steps-accent-text: var(--xh-_tone-fg);
|
|
398
|
+
--xh-_steps-accent-mark: var(--xh-_tone-fg);
|
|
399
|
+
--xh-_steps-on-accent: var(--xh-_tone-on);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/* 标了语气的那一步还没走到也得被看见:空心描边加同色数字,不动实心那档的内高光 */
|
|
403
|
+
.xh-scope-steps[data-part='item'][data-tone]
|
|
404
|
+
.xh-scope-steps[data-part='indicator'][data-state='incomplete'] {
|
|
405
|
+
border-color: var(--xh-steps-indicator-border-toned, var(--xh-_steps-accent));
|
|
406
|
+
background: var(--xh-steps-indicator-bg-toned, var(--xh-_tone-subtle));
|
|
407
|
+
color: var(--xh-steps-indicator-fg-toned, var(--xh-_steps-accent-text));
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.xh-scope-steps[data-part='item'][data-disabled] .xh-scope-steps[data-part='indicator'] {
|
|
411
|
+
border-color: var(--xh-steps-indicator-border-disabled, var(--xh-border-default));
|
|
412
|
+
background: var(--xh-steps-indicator-bg-disabled, var(--xh-bg-muted));
|
|
413
|
+
color: var(--xh-steps-indicator-fg-disabled, var(--xh-fg-disabled));
|
|
414
|
+
/* 这一步动不了,实心那档的内高光跟着收掉 */
|
|
415
|
+
box-shadow: none;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/* 标题与说明都在右列:不给 display,网格布局会替它们块级化,
|
|
419
|
+
[hidden] 时 UA 的 display:none 仍然压得住 */
|
|
420
|
+
.xh-scope-steps[data-part='title'] {
|
|
421
|
+
grid-column: 2;
|
|
422
|
+
color: var(--xh-steps-title-fg, var(--xh-fg-muted));
|
|
423
|
+
font-size: var(--xh-steps-title-font-size, var(--xh-_steps-title-font-size));
|
|
424
|
+
font-weight: var(--xh-steps-title-font-weight, var(--xh-text-label-weight));
|
|
425
|
+
line-height: var(--xh-leading-tight);
|
|
426
|
+
overflow: hidden;
|
|
427
|
+
white-space: nowrap;
|
|
428
|
+
text-overflow: ellipsis;
|
|
429
|
+
/* 走到这一步、走过这一步时标题换色,与圆点的换面同一段淡变 */
|
|
430
|
+
transition: color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.xh-scope-steps[data-part='title']:is([data-state='current'], [data-state='completed']) {
|
|
434
|
+
color: var(--xh-steps-title-fg-active, var(--xh-_steps-accent-text));
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/* 标了语气的那一步标题跟着换色,不论走到没走到 */
|
|
438
|
+
.xh-scope-steps[data-part='item'][data-tone] .xh-scope-steps[data-part='title'] {
|
|
439
|
+
color: var(--xh-steps-title-fg-toned, var(--xh-_steps-accent-text));
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/* 说明走说明角色:13 / fg-muted / leading-normal,不随 size 档 */
|
|
443
|
+
.xh-scope-steps[data-part='description'] {
|
|
444
|
+
grid-column: 2;
|
|
445
|
+
color: var(--xh-steps-description-fg, var(--xh-fg-muted));
|
|
446
|
+
font-size: var(--xh-steps-description-font-size, var(--xh-text-secondary-size));
|
|
447
|
+
line-height: var(--xh-leading-normal);
|
|
448
|
+
overflow: hidden;
|
|
449
|
+
white-space: nowrap;
|
|
450
|
+
text-overflow: ellipsis;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/* 连接线属于它前面那一步:那一步走过了就点亮,进度因此是连续的一条线。点亮的那一层叠在底线上,
|
|
454
|
+
沿行向从这一步填到下一步(数值角色:move / continuous,只动 clip-path),回退时反向收回 */
|
|
455
|
+
.xh-scope-steps[data-part='separator'] {
|
|
456
|
+
position: relative;
|
|
457
|
+
flex: 1;
|
|
458
|
+
min-inline-size: var(--xh-steps-separator-min-length, var(--xh-space-4));
|
|
459
|
+
block-size: var(--xh-steps-separator-thickness, var(--xh-stroke-thick));
|
|
460
|
+
border-radius: var(--xh-steps-separator-radius, var(--xh-shape-pill));
|
|
461
|
+
background: var(--xh-steps-separator-bg, var(--xh-border-default));
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/* 没走过时把行尾那一侧整段裁掉:inset 的左右两侧乘书写方向符号,ltr 裁右侧、rtl 裁左侧 */
|
|
465
|
+
.xh-scope-steps[data-part='separator']::after {
|
|
466
|
+
content: '';
|
|
467
|
+
position: absolute;
|
|
468
|
+
inset: 0;
|
|
469
|
+
border-radius: inherit;
|
|
470
|
+
background: var(--xh-steps-separator-bg-completed, var(--xh-_steps-accent));
|
|
471
|
+
clip-path: inset(0 calc(50% + 50% * var(--xh-direction-sign)) 0 calc(50% - 50% * var(--xh-direction-sign)));
|
|
472
|
+
transition: clip-path var(--xh-motion-duration-move) var(--xh-motion-ease-continuous);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.xh-scope-steps[data-part='separator'][hidden] {
|
|
476
|
+
display: none;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.xh-scope-steps[data-part='separator'][data-state='completed']::after {
|
|
480
|
+
clip-path: inset(0);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/* 纵向时连接线转成竖的一条,缩进到与序号圆点同一条竖线上 */
|
|
484
|
+
.xh-scope-steps[data-part='separator'][data-orientation='vertical'] {
|
|
485
|
+
flex: none;
|
|
486
|
+
inline-size: var(--xh-steps-separator-thickness, var(--xh-stroke-thick));
|
|
487
|
+
min-inline-size: var(--xh-steps-separator-thickness, var(--xh-stroke-thick));
|
|
488
|
+
block-size: var(--xh-steps-separator-min-length, var(--xh-space-7));
|
|
489
|
+
/* 圆点半径加上它四周留给环的位置,减去线宽的一半:calc 里的除法要写成乘 0.5,除号在这儿是无效语法 */
|
|
490
|
+
margin-inline-start: calc(
|
|
491
|
+
var(--xh-steps-indicator-size, var(--xh-_steps-indicator-size)) * 0.5
|
|
492
|
+
+ var(--xh-_steps-indicator-margin)
|
|
493
|
+
+ var(--xh-steps-trigger-p, var(--xh-control-px-sm))
|
|
494
|
+
- var(--xh-steps-separator-thickness, var(--xh-stroke-thick)) * 0.5
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/* 纵向时从上往下填:没走过时裁掉下端 */
|
|
499
|
+
.xh-scope-steps[data-part='separator'][data-orientation='vertical']::after {
|
|
500
|
+
clip-path: inset(0 0 100% 0);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.xh-scope-steps[data-part='separator'][data-orientation='vertical'][data-state='completed']::after {
|
|
504
|
+
clip-path: inset(0);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/* 面板刻意不给 display:连接层用 hidden 收起,UA 的 [hidden]{display:none} 压得住,
|
|
508
|
+
不必再拿内联样式去盖 */
|
|
509
|
+
.xh-scope-steps[data-part='content'] {
|
|
510
|
+
padding-block: var(--xh-steps-content-py, var(--xh-stack-gap-md));
|
|
511
|
+
color: var(--xh-steps-content-fg, var(--xh-fg-default));
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/* 没写内容就由皮肤画兜底对号;作者往部件里塞了自己的图形,这几条即不命中。
|
|
515
|
+
尺寸读圆点自己改接过的 --xh-icon-size:指示符档,随密度换档(见圆点块)。
|
|
516
|
+
点状形态不盛内容,走过的点本身就是标记,不画对号 */
|
|
517
|
+
.xh-scope-steps[data-part='indicator'][data-state='completed']:not([data-variant='dot']):empty::before {
|
|
518
|
+
content: '';
|
|
519
|
+
display: inline-block;
|
|
520
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-sm));
|
|
521
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-sm));
|
|
522
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
523
|
+
background-color: currentColor;
|
|
524
|
+
-webkit-mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
525
|
+
mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/* 走过这一步那一刻:序号撤下、对号淡入,与圆点的换面同一段淡变;首帧就走过的(data-instant)直接呈现 */
|
|
529
|
+
.xh-scope-steps[data-part='indicator'][data-state='completed']:not([data-instant]):empty::before {
|
|
530
|
+
animation: xh-fade-in var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
@media (forced-colors: active) {
|
|
534
|
+
/* 触发器的悬停 / 按下由家族 forced-colors 块涂成 Highlight / HighlightText;标题与说明各自写了颜色,
|
|
535
|
+
这一档里会被换成 CanvasText 压在高亮底上,悬停与按住时一起跟到反色 */
|
|
536
|
+
.xh-scope-steps[data-part='trigger']:not([data-disabled]):is(:hover, :active, [data-pressed])
|
|
537
|
+
:is(.xh-scope-steps[data-part='title'], .xh-scope-steps[data-part='description']) {
|
|
538
|
+
color: HighlightText;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.xh-scope-steps[data-part='trigger']:hover:not([data-disabled], [data-readonly])
|
|
542
|
+
.xh-scope-steps[data-part='indicator'][data-state='incomplete']:not([data-variant='dot']) {
|
|
543
|
+
border-color: Highlight;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/* 连接线画的是一块纯底色,这一档里底色被统一换成 Canvas,整条进度线消失,
|
|
547
|
+
只剩一排孤立的圆点。走过的那几截换成系统高亮色,其余换成前景色 */
|
|
548
|
+
.xh-scope-steps[data-part='separator'] {
|
|
549
|
+
background: CanvasText;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
.xh-scope-steps[data-part='separator']::after {
|
|
553
|
+
background: Highlight;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
/* 点状形态的点靠底色画实心,这一档里底色被换成 Canvas,走过与当前步的点会与空心的圈混成一样。
|
|
557
|
+
实心的点与当前步那圈环换成 CanvasText:整行悬停涂成 Highlight 时照样看得见,走过与当前步靠那圈环分开;
|
|
558
|
+
动不了的取 GrayText */
|
|
559
|
+
.xh-scope-steps[data-part='trigger'] .xh-scope-steps[data-part='indicator'][data-variant='dot']:not([data-state='incomplete']) {
|
|
560
|
+
border-color: CanvasText;
|
|
561
|
+
background: CanvasText;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
.xh-scope-steps[data-part='item'][data-disabled] .xh-scope-steps[data-part='indicator'][data-variant='dot'] {
|
|
565
|
+
border-color: GrayText;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
.xh-scope-steps[data-part='item'][data-disabled]
|
|
569
|
+
.xh-scope-steps[data-part='trigger'] .xh-scope-steps[data-part='indicator'][data-variant='dot']:not([data-state='incomplete']) {
|
|
570
|
+
background: GrayText;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/* 环是一层角向渐变,这一档里渐变会被当作背景图丢掉:环自己不让系统接管配色,弧与轨道改取系统色——
|
|
574
|
+
弧 CanvasText、进度环的轨道 GrayText(两者分得开,才读得出走了多少);动不了的弧 GrayText,
|
|
575
|
+
轨道退到 Canvas,免得与弧同色读不出比例 */
|
|
576
|
+
.xh-scope-steps[data-part='indicator']::after {
|
|
577
|
+
--xh-_steps-ring-arc: CanvasText;
|
|
578
|
+
|
|
579
|
+
forced-color-adjust: none;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.xh-scope-steps[data-part='indicator'][data-progress]::after {
|
|
583
|
+
--xh-_steps-ring-track: GrayText;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.xh-scope-steps[data-part='item'][data-disabled] .xh-scope-steps[data-part='indicator']::after {
|
|
587
|
+
--xh-_steps-ring-arc: GrayText;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
.xh-scope-steps[data-part='item'][data-disabled] .xh-scope-steps[data-part='indicator'][data-progress]::after {
|
|
591
|
+
--xh-_steps-ring-track: Canvas;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
@media print {
|
|
596
|
+
/* 打印默认丢背景:走过那几步的实心底与里面那枚勾都印不出来,
|
|
597
|
+
当前步与走过的步只剩一模一样的一圈细描边。改用描边的粗细与字重表达同一件事 */
|
|
598
|
+
.xh-scope-steps[data-part='indicator']:is([data-state='current'], [data-state='completed']) {
|
|
599
|
+
border-width: var(--xh-stroke-thick);
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
.xh-scope-steps[data-part='title'][data-state='current'] {
|
|
603
|
+
font-weight: var(--xh-font-weight-semibold);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/* 点状形态的点与当前步那圈环都是底色画的,丢了底色走过与当前步就只剩空心圈:这两样照原色印 */
|
|
607
|
+
.xh-scope-steps[data-part='indicator'][data-variant='dot'],
|
|
608
|
+
.xh-scope-steps[data-part='indicator']::after {
|
|
609
|
+
print-color-adjust: exact;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
@media (forced-colors: active) {
|
|
614
|
+
/* 兜底字形是 mask 挖出来的一块底色,这一档里底色被系统换成 Canvas,字形跟着消失。
|
|
615
|
+
字形退出强制换色、直接写系统色(不能取 currentColor:退出强制换色的伪元素读到的是被系统换掉之前的作者色):
|
|
616
|
+
落在勾选盒自己的实心面上(这一档里是 Canvas),整行悬停不换面,取 CanvasText;
|
|
617
|
+
禁用取 GrayText */
|
|
618
|
+
.xh-scope-steps[data-part='indicator'][data-state='completed']:not([data-variant='dot']):empty::before {
|
|
619
|
+
forced-color-adjust: none;
|
|
620
|
+
background-color: CanvasText;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.xh-scope-steps[data-part='item'][data-disabled] .xh-scope-steps[data-part='indicator'][data-state='completed']:not([data-variant='dot']):empty::before {
|
|
624
|
+
background-color: GrayText;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|