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