@xihan-ui/styles 1.0.0 → 2.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 +5146 -6
- package/README.md +22 -2
- package/component-tokens.d.ts +4212 -0
- package/component-tokens.js +2 -0
- package/components.tokens.json +80116 -0
- package/css/accordion.css +131 -75
- package/css/affix.css +16 -1
- package/css/alert.css +114 -67
- package/css/anchor.css +99 -27
- package/css/approval.css +461 -0
- package/css/avatar-group.css +14 -6
- package/css/avatar.css +33 -9
- package/css/back-top.css +103 -48
- package/css/badge.css +42 -14
- package/css/bar-code.css +62 -0
- package/css/breadcrumb.css +40 -21
- package/css/button-group.css +146 -24
- package/css/button.css +116 -99
- package/css/calendar-picker.css +448 -0
- package/css/calendar-range-picker.css +517 -0
- package/css/card.css +54 -77
- package/css/carousel.css +412 -68
- package/css/cascader.css +429 -246
- package/css/checkbox-group.css +225 -77
- package/css/checkbox.css +174 -37
- package/css/clipboard.css +266 -47
- package/css/code-view.css +279 -0
- package/css/collapsible.css +108 -63
- package/css/color-field.css +158 -0
- package/css/color-picker.css +172 -184
- package/css/color-slider.css +274 -0
- package/css/color-swatch-picker.css +243 -0
- package/css/color-swatch.css +35 -0
- package/css/combobox.css +267 -273
- package/css/command.css +399 -0
- package/css/context-menu.css +183 -108
- package/css/date-field.css +94 -121
- package/css/date-picker.css +486 -249
- package/css/date-range-picker.css +559 -0
- package/css/description.css +51 -0
- package/css/descriptions.css +133 -87
- package/css/dialog.css +247 -68
- package/css/diff-view.css +428 -0
- package/css/download-trigger.css +155 -46
- package/css/drawer.css +194 -111
- package/css/editable.css +172 -152
- package/css/empty-state.css +80 -11
- package/css/field-array.css +190 -0
- package/css/field.css +84 -31
- package/css/fieldset.css +51 -18
- package/css/file-upload.css +134 -36
- package/css/flex.css +20 -1
- package/css/float-button.css +238 -57
- package/css/floating-panel.css +173 -92
- package/css/focus.css +46 -0
- package/css/forced-colors.css +93 -0
- package/css/form.css +254 -77
- package/css/gradient-text.css +34 -10
- package/css/grid.css +516 -5
- package/css/heatmap.css +87 -29
- package/css/highlight.css +20 -5
- package/css/hover-card.css +97 -47
- package/css/icon-wrapper.css +15 -3
- package/css/icon.css +74 -8
- package/css/image-cropper.css +143 -29
- package/css/image-viewer.css +150 -89
- package/css/image.css +30 -1
- package/css/infinite-scroll.css +51 -1
- package/css/input-group.css +277 -0
- package/css/json-viewer.css +102 -45
- package/css/kbd.css +72 -0
- package/css/label.css +78 -0
- package/css/layers.css +5 -0
- package/css/layout.css +175 -31
- package/css/list.css +24 -3
- package/css/listbox.css +208 -67
- package/css/loading-bar.css +52 -3
- package/css/log.css +144 -9
- package/css/markdown-stream.css +149 -0
- package/css/marquee.css +27 -1
- package/css/masonry.css +7 -0
- package/css/matrix-code.css +67 -0
- package/css/mention.css +234 -152
- package/css/menu.css +180 -83
- package/css/menubar.css +204 -136
- package/css/message-feed.css +197 -0
- package/css/navigation-menu.css +144 -90
- package/css/notification.css +178 -100
- package/css/number-animation.css +7 -0
- package/css/number-field.css +120 -277
- package/css/overlay-arrow.css +12 -7
- package/css/page-header.css +99 -14
- package/css/pagination.css +175 -135
- package/css/password-input.css +222 -219
- package/css/pin-input.css +101 -67
- package/css/pointer.css +36 -0
- package/css/popconfirm.css +185 -94
- package/css/popover.css +121 -77
- package/css/progress.css +60 -12
- package/css/prompt-input.css +224 -0
- package/css/question-flow.css +513 -0
- package/css/radio-group.css +147 -30
- package/css/rating.css +193 -43
- package/css/reasoning.css +336 -0
- package/css/reset.css +84 -6
- package/css/resizable.css +237 -0
- package/css/scroll-area.css +68 -7
- package/css/scrollbar.css +47 -13
- package/css/segmented.css +94 -29
- package/css/select.css +288 -274
- package/css/separator.css +101 -1
- package/css/side-nav.css +133 -75
- package/css/signature-pad.css +74 -54
- package/css/skeleton.css +84 -11
- package/css/slider.css +132 -39
- package/css/sortable.css +198 -0
- package/css/spinner.css +126 -12
- package/css/splitter.css +29 -8
- package/css/statistic.css +55 -0
- package/css/steps.css +206 -72
- package/css/switch.css +268 -36
- package/css/table.css +695 -118
- package/css/tabs.css +604 -42
- package/css/tag-group.css +219 -0
- package/css/tag.css +118 -28
- package/css/tags-input.css +156 -274
- package/css/text-field.css +101 -249
- package/css/time-field.css +100 -128
- package/css/time-picker.css +323 -252
- package/css/time-range-picker.css +719 -0
- package/css/timeline.css +202 -68
- package/css/timer.css +56 -52
- package/css/timestamp.css +34 -0
- package/css/toast.css +373 -144
- package/css/toggle-group.css +309 -76
- package/css/toggle.css +116 -85
- package/css/tone.css +47 -0
- package/css/tool-call.css +421 -0
- package/css/toolbar.css +181 -33
- package/css/tooltip.css +107 -36
- package/css/tour.css +183 -152
- package/css/transfer.css +351 -138
- package/css/tree-select.css +323 -216
- package/css/tree.css +294 -62
- package/css/truncate.css +65 -0
- package/css/typography.css +228 -5
- package/css/undefined.css +10 -1
- package/css/virtualizer.css +9 -10
- package/css/visually-hidden.css +7 -0
- package/css/watermark.css +7 -0
- package/family/action-control.css +487 -0
- package/family/collection-item.css +721 -0
- package/family/field-chrome.css +298 -0
- package/family/motion.css +166 -0
- package/family/swatch.css +59 -0
- package/index.css +41705 -126
- package/index.unlayered.css +33692 -17339
- package/package.json +51 -17
- package/css/calendar.css +0 -367
- package/css/code-block.css +0 -91
- package/css/composer.css +0 -134
- package/css/countdown.css +0 -26
- package/css/dynamic-input.css +0 -220
- package/css/ellipsis.css +0 -52
- package/css/hotkeys.css +0 -90
- package/css/popselect.css +0 -391
- package/css/qr-code.css +0 -55
- package/css/result.css +0 -119
- package/css/space.css +0 -117
- package/css/thread.css +0 -120
- package/css/time.css +0 -25
package/css/steps.css
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
@layer xihan.components {
|
|
2
11
|
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
3
12
|
[data-scope='steps'] {
|
|
@@ -5,21 +14,34 @@
|
|
|
5
14
|
}
|
|
6
15
|
|
|
7
16
|
[data-scope='steps'][data-part='root'] {
|
|
8
|
-
/*
|
|
9
|
-
|
|
17
|
+
/* 作者放进标题 / 说明里的图标按档取尺,缺省 sm(§6.5)。走过的步里皮肤画的兜底对号不读这支:
|
|
18
|
+
它是指示符,与序号圆点同走 --xh-control-indicator-* 一族——圆点在自己身上把 --xh-icon-size
|
|
19
|
+
改接到 --xh-steps-indicator-mark-size,兜底对号与作者塞进圆点里的 XhIcon 读同一把尺 */
|
|
20
|
+
--xh-icon-size: var(--xh-steps-icon-size, var(--xh-glyph-size-sm));
|
|
10
21
|
|
|
11
|
-
/*
|
|
12
|
-
|
|
13
|
-
--xh-_steps-indicator-size: var(--xh-space-
|
|
22
|
+
/* 尺寸档只换这三个私有槽,序号圆点、标题与圆点里的序号都从 root 继承它们,
|
|
23
|
+
换档不必给每个部件各写一条选择器;说明走说明角色(13px),不随档 */
|
|
24
|
+
--xh-_steps-indicator-size: var(--xh-space-8);
|
|
14
25
|
--xh-_steps-title-font-size: var(--xh-control-font-md);
|
|
15
26
|
--xh-_steps-caption-font-size: var(--xh-text-caption-size);
|
|
16
27
|
|
|
17
|
-
/*
|
|
18
|
-
accent-text
|
|
19
|
-
没写 data-tone 时 --xh-_tone
|
|
28
|
+
/* 语气落在当前步的标记、走过那几步的对号与连接线上:强调色画描边与填充,
|
|
29
|
+
accent-text 是普通底上的强调文字(走过与当前步的标题),on-accent 是实心底上的前景。
|
|
30
|
+
没写 data-tone 时 --xh-_tone 一族没被声明,三个槽都退回原来的品牌配色。
|
|
31
|
+
走过的步不再用品牌淡底(§7.3 brand-subtle 退出 completed 语义),淡底那两支私有槽随之撤掉 */
|
|
20
32
|
--xh-_steps-accent: var(--xh-_tone, var(--xh-bg-brand));
|
|
21
|
-
--xh-_steps-accent-text: var(--xh-_tone-fg, var(--xh-
|
|
33
|
+
--xh-_steps-accent-text: var(--xh-_tone-fg, var(--xh-fg-brand-strong));
|
|
34
|
+
/* 走过的步里那枚对号:中性淡底上的品牌色标记,不用标题那档更深的字色 */
|
|
35
|
+
--xh-_steps-accent-mark: var(--xh-_tone-fg, var(--xh-fg-brand));
|
|
22
36
|
--xh-_steps-on-accent: var(--xh-_tone-on, var(--xh-fg-on-brand));
|
|
37
|
+
/* 触发器是序号圆点的承载面:圆点静息就坐在 --xh-bg-subtle(100)的淡底上,阶梯按淡底容器走
|
|
38
|
+
(hover 200 → pressed 300,§7.2 第 3 条)。两支私有槽是这一档的唯一来源——触发器拿它们给
|
|
39
|
+
--xh-action-host-bg-* 赋值(桥接槽只写不读),圆点悬停 / 按下读同一支私有槽,即与宿主的 host 槽同源 */
|
|
40
|
+
--xh-_steps-host-bg-hover: var(--xh-bg-subtle-hover);
|
|
41
|
+
--xh-_steps-host-bg-pressed: var(--xh-bg-subtle-active);
|
|
42
|
+
/* 走过的那几步是实心圆,顶边画一条极浅的内高光把它衬出厚度 */
|
|
43
|
+
--xh-_steps-highlight: inset 0 var(--xh-stroke-thin) 0 0
|
|
44
|
+
color-mix(in oklab, var(--xh-_steps-on-accent) 14%, transparent);
|
|
23
45
|
|
|
24
46
|
display: flex;
|
|
25
47
|
flex-direction: column;
|
|
@@ -30,47 +52,52 @@
|
|
|
30
52
|
display: none;
|
|
31
53
|
}
|
|
32
54
|
|
|
33
|
-
/*
|
|
55
|
+
/* 纵向:步骤列与面板并排;两栏一起放不下时面板换到下一行,步骤列因此拿得回整行宽度 */
|
|
34
56
|
[data-scope='steps'][data-part='root'][data-orientation='vertical'] {
|
|
35
57
|
flex-direction: row;
|
|
58
|
+
flex-wrap: wrap;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* 面板的换行基准:一行正文的宽度。步骤列的内容宽加上这一格放不下,两者就分成两行 */
|
|
62
|
+
[data-scope='steps'][data-part='root'][data-orientation='vertical'] > [data-scope='steps'][data-part='content'] {
|
|
63
|
+
flex: 1 1 var(--xh-steps-content-min-inline-size, var(--xh-measure-prose));
|
|
36
64
|
}
|
|
37
65
|
|
|
38
66
|
/* —— 尺寸 —— */
|
|
39
67
|
/* 缺省档写在上面的基础规则里。圆点直径不在 control-h 那把尺上(缺省是 sm 档的 28px),
|
|
40
68
|
两侧改从 space 档取,缺省档才留得住 */
|
|
41
69
|
[data-scope='steps'][data-part='root'][data-size='sm'] {
|
|
42
|
-
--xh-_steps-indicator-size: var(--xh-space-
|
|
70
|
+
--xh-_steps-indicator-size: var(--xh-space-7);
|
|
43
71
|
--xh-_steps-title-font-size: var(--xh-control-font-sm);
|
|
44
|
-
/* 字号档最小就是 xs
|
|
72
|
+
/* 字号档最小就是 xs,序号不再往下走,故不重声明 caption */
|
|
45
73
|
}
|
|
46
74
|
|
|
47
75
|
[data-scope='steps'][data-part='root'][data-size='lg'] {
|
|
48
|
-
--xh-_steps-indicator-size: var(--xh-
|
|
76
|
+
--xh-_steps-indicator-size: var(--xh-control-h-lg);
|
|
49
77
|
--xh-_steps-title-font-size: var(--xh-control-font-lg);
|
|
50
78
|
--xh-_steps-caption-font-size: var(--xh-text-secondary-size);
|
|
51
79
|
}
|
|
52
80
|
|
|
81
|
+
/* 步骤与连接线必须保持在同一条流程轴上,空间不足时由标题省略而不是拆成两行。 */
|
|
53
82
|
[data-scope='steps'][data-part='list'] {
|
|
54
83
|
display: flex;
|
|
55
|
-
|
|
56
|
-
|
|
84
|
+
flex-wrap: nowrap;
|
|
85
|
+
align-items: flex-start;
|
|
86
|
+
gap: var(--xh-steps-list-gap, var(--xh-space-0));
|
|
57
87
|
}
|
|
58
88
|
|
|
59
89
|
[data-scope='steps'][data-part='list'][hidden] {
|
|
60
90
|
display: none;
|
|
61
91
|
}
|
|
62
92
|
|
|
93
|
+
/* 竖排时列被拉到与面板同高,那是一个确定的块向尺寸;折行在这里会把步骤摊成两列,
|
|
94
|
+
所以这一档明确关掉 */
|
|
63
95
|
[data-scope='steps'][data-part='list'][data-orientation='vertical'] {
|
|
64
96
|
flex-direction: column;
|
|
97
|
+
flex-wrap: nowrap;
|
|
65
98
|
align-items: stretch;
|
|
66
99
|
}
|
|
67
100
|
|
|
68
|
-
/* 组内无锚点时 list 自己在 Tab 序列里(走到完成位就是这种情形),落焦要看得见 */
|
|
69
|
-
[data-scope='steps'][data-part='list']:focus-visible {
|
|
70
|
-
outline: var(--xh-ring-width) solid var(--xh-ring-focus);
|
|
71
|
-
outline-offset: var(--xh-ring-offset);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
101
|
/* 每一步与它后面那截连接线一起占一格,等分整行;min-inline-size 允许被压缩,
|
|
75
102
|
标题里的省略号才有生效的余地 */
|
|
76
103
|
[data-scope='steps'][data-part='item'] {
|
|
@@ -85,67 +112,84 @@
|
|
|
85
112
|
display: none;
|
|
86
113
|
}
|
|
87
114
|
|
|
88
|
-
/* 末步后面没有"下一步"
|
|
115
|
+
/* 末步后面没有"下一步",那截连接线不该占地方;作者不写它也一样,写了就替他收掉。
|
|
116
|
+
末步按内容宽摆、不参与伸缩,标题长过整行时由 100% 收住,超出的部分走省略号 */
|
|
89
117
|
[data-scope='steps'][data-part='item']:last-child {
|
|
90
118
|
flex: none;
|
|
119
|
+
max-inline-size: 100%;
|
|
91
120
|
}
|
|
92
121
|
|
|
93
122
|
[data-scope='steps'][data-part='item']:last-child [data-scope='steps'][data-part='separator'] {
|
|
94
123
|
display: none;
|
|
95
124
|
}
|
|
96
125
|
|
|
126
|
+
/* 横排始终留在同一条轴上,标题与说明负责在自己的格内省略。 */
|
|
127
|
+
[data-scope='steps'][data-part='item'][data-orientation='horizontal']:not(:last-child) {
|
|
128
|
+
min-inline-size: var(--xh-steps-item-min-inline-size, var(--xh-space-0));
|
|
129
|
+
}
|
|
130
|
+
|
|
97
131
|
[data-scope='steps'][data-part='item'][data-orientation='vertical'] {
|
|
98
132
|
flex-direction: column;
|
|
99
133
|
flex: none;
|
|
100
134
|
align-items: flex-start;
|
|
101
135
|
}
|
|
102
136
|
|
|
103
|
-
/*
|
|
104
|
-
|
|
105
|
-
|
|
137
|
+
/* 触发器是「序号 + 标题 + 说明」的整块内容行(§9.2):接 Action Control row 档、ghost 形态,悬停 / 按下 / 禁用面、
|
|
138
|
+
手型、过渡与焦点环由家族给,按下只换面不缩放(row 档专属按压块 scale: none);这里只把使用者槽映射到桥接槽。
|
|
139
|
+
触发器既是 Action Control 又是圆点的承载面:自己坐画布走 hover 100 → pressed 200,由 --xh-action-bg-* 钉住;
|
|
140
|
+
--xh-action-host-bg-* 只对圆点生效(圆点自己是 100 的淡底,坐在触发器面上再上一档到 200 / 300)。
|
|
141
|
+
排成两列:序号占左列并跨两行,标题与说明各占右列一行。用 grid 而不是再包一层节点——解剖里没有那个包裹层,
|
|
142
|
+
作者也不该被逼着多写一个 div;只有说明缺席时右列的第二行是零高,不会留白 */
|
|
106
143
|
[data-scope='steps'][data-part='trigger'] {
|
|
144
|
+
/* 纵向留一圈给悬停底色与焦点环,横向走控件内边距尺的小档;一个槽同时盖住两轴 */
|
|
145
|
+
--xh-action-padding-block: var(--xh-steps-trigger-p, var(--xh-space-1));
|
|
146
|
+
--xh-action-padding-inline: var(--xh-steps-trigger-p, var(--xh-control-px-sm));
|
|
147
|
+
--xh-action-radius: var(--xh-steps-trigger-radius, var(--xh-shape-control));
|
|
148
|
+
/* 列距仍由 column-gap 给:家族的 gap 会连 row-gap 一起把标题与说明撑开 */
|
|
149
|
+
--xh-action-gap: 0;
|
|
150
|
+
/* 高度由圆点 + 内距决定,不取 control-h 地板 */
|
|
151
|
+
--xh-action-visual-size: 0;
|
|
152
|
+
--xh-action-font-size: inherit;
|
|
153
|
+
/* 标题 / 说明 / 圆点各自着色,行本身不定字色 */
|
|
154
|
+
--xh-action-fg-rest: currentColor;
|
|
155
|
+
--xh-action-fg-hover: currentColor;
|
|
156
|
+
--xh-action-fg-pressed: currentColor;
|
|
157
|
+
--xh-action-fg-focus-visible: currentColor;
|
|
158
|
+
--xh-action-fg-disabled: currentColor;
|
|
159
|
+
--xh-action-bg-hover: var(--xh-steps-trigger-bg-hover, var(--xh-bg-subtle));
|
|
160
|
+
--xh-action-bg-pressed: var(--xh-steps-trigger-bg-pressed, var(--xh-bg-subtle-hover));
|
|
161
|
+
--xh-action-host-bg-hover: var(--xh-_steps-host-bg-hover);
|
|
162
|
+
--xh-action-host-bg-pressed: var(--xh-_steps-host-bg-pressed);
|
|
163
|
+
|
|
164
|
+
/* 皮肤规则排在 @import 之后,同特指度盖过 row 档的 display: flex */
|
|
107
165
|
display: grid;
|
|
108
166
|
grid-template-columns: auto minmax(0, 1fr);
|
|
109
167
|
align-items: center;
|
|
110
168
|
column-gap: var(--xh-steps-trigger-gap, var(--xh-control-gap-md));
|
|
111
|
-
/*
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
border: 0;
|
|
115
|
-
border-radius: var(--xh-steps-trigger-radius, var(--xh-shape-control));
|
|
116
|
-
background: transparent;
|
|
117
|
-
color: inherit;
|
|
169
|
+
/* row 档铺满容器(inline-size: 100%)会把横排的连接线压到最小长度 */
|
|
170
|
+
inline-size: auto;
|
|
171
|
+
/* 纵向连接线的 margin-inline-start 按圆点半径 + trigger-p 对齐圆心,ghost 的 1px 透明边位会让它错 1px */
|
|
172
|
+
border-width: 0;
|
|
118
173
|
font: inherit;
|
|
119
174
|
text-align: start;
|
|
120
|
-
cursor: pointer;
|
|
121
175
|
}
|
|
122
176
|
|
|
123
177
|
[data-scope='steps'][data-part='trigger'][hidden] {
|
|
124
178
|
display: none;
|
|
125
179
|
}
|
|
126
180
|
|
|
127
|
-
[data-scope='steps'][data-part='trigger']:hover:not([data-disabled]) {
|
|
128
|
-
background: var(--xh-steps-trigger-bg-hover, var(--xh-bg-subtle-hover));
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
[data-scope='steps'][data-part='trigger']:focus-visible {
|
|
132
|
-
outline: var(--xh-ring-width) solid var(--xh-ring-focus);
|
|
133
|
-
outline-offset: var(--xh-ring-offset);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/* 禁用走 aria-disabled 而非原生 disabled:条目仍要可聚焦(它还得当方向键的起点),
|
|
137
|
-
所以只能挂 data-disabled,写 :disabled 永远不命中 */
|
|
138
|
-
[data-scope='steps'][data-part='trigger'][data-disabled] {
|
|
139
|
-
cursor: not-allowed;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
181
|
[data-scope='steps'][data-part='item'][data-disabled] [data-scope='steps'][data-part='title'],
|
|
143
182
|
[data-scope='steps'][data-part='item'][data-disabled] [data-scope='steps'][data-part='description'] {
|
|
144
183
|
color: var(--xh-fg-disabled);
|
|
145
184
|
}
|
|
146
185
|
|
|
147
|
-
/*
|
|
186
|
+
/* 序号圆点:未开始使用中性面,当前步骤实心强调,已完成步骤中性面上画品牌对号(§7.3)。 */
|
|
148
187
|
[data-scope='steps'][data-part='indicator'] {
|
|
188
|
+
/* 圆点里的字形是指示符(§6.5):对号按指示符档取尺、随密度换档(comfortable 16 / compact 14),
|
|
189
|
+
不读 root 上只管作者标题 / 说明图标的 --xh-steps-icon-size;作者塞进圆点的 XhIcon 与兜底对号同一把尺。
|
|
190
|
+
圆点自己走 space / control-h 的尺(最小 28px),不随密度,两档字形在三档圆点里都留得出边距 */
|
|
191
|
+
--xh-icon-size: var(--xh-steps-indicator-mark-size, var(--xh-control-indicator-size));
|
|
192
|
+
|
|
149
193
|
display: inline-flex;
|
|
150
194
|
grid-row: 1 / span 2;
|
|
151
195
|
flex: none;
|
|
@@ -153,9 +197,9 @@
|
|
|
153
197
|
justify-content: center;
|
|
154
198
|
inline-size: var(--xh-steps-indicator-size, var(--xh-_steps-indicator-size));
|
|
155
199
|
block-size: var(--xh-steps-indicator-size, var(--xh-_steps-indicator-size));
|
|
156
|
-
border: var(--xh-stroke-thin) solid var(--xh-steps-indicator-border,
|
|
157
|
-
border-radius: var(--xh-steps-indicator-radius, var(--xh-shape-
|
|
158
|
-
background: var(--xh-steps-indicator-bg,
|
|
200
|
+
border: var(--xh-stroke-thin) solid var(--xh-steps-indicator-border, transparent);
|
|
201
|
+
border-radius: var(--xh-steps-indicator-radius, var(--xh-shape-circle));
|
|
202
|
+
background: var(--xh-steps-indicator-bg, var(--xh-bg-subtle));
|
|
159
203
|
color: var(--xh-steps-indicator-fg, var(--xh-fg-muted));
|
|
160
204
|
font-size: var(--xh-steps-indicator-font-size, var(--xh-_steps-caption-font-size));
|
|
161
205
|
font-weight: var(--xh-font-weight-medium);
|
|
@@ -165,6 +209,7 @@
|
|
|
165
209
|
transition:
|
|
166
210
|
background var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
167
211
|
border-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
212
|
+
box-shadow var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
168
213
|
color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
169
214
|
}
|
|
170
215
|
|
|
@@ -172,22 +217,72 @@
|
|
|
172
217
|
display: none;
|
|
173
218
|
}
|
|
174
219
|
|
|
175
|
-
/*
|
|
176
|
-
|
|
220
|
+
/* 圆点是格状当前的标记(§4.1 / §7.3),但不是激活宿主:宿主是投影了 row 档的触发器;圆点在宿主的
|
|
221
|
+
:hover / :is(:active, [data-pressed]) 下读宿主 host 槽的同一来源换面,同一时间线,不缩放(§9.2)——
|
|
222
|
+
圆点自己是 100 的淡底,坐在触发器的 hover 面(100)上,再上一档到 200 才与承载面分得开,按下到 300;
|
|
223
|
+
当前步的实心面按下换语气 active 档 */
|
|
224
|
+
[data-scope='steps'][data-part='trigger']:hover:not([data-disabled])
|
|
225
|
+
[data-scope='steps'][data-part='indicator'][data-state='incomplete'] {
|
|
226
|
+
background: var(--xh-steps-indicator-bg-hover, var(--xh-_steps-host-bg-hover));
|
|
227
|
+
color: var(--xh-steps-indicator-fg-hover, var(--xh-fg-default));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
[data-scope='steps'][data-part='trigger']:hover:not([data-disabled])
|
|
231
|
+
[data-scope='steps'][data-part='indicator'][data-state='completed'] {
|
|
232
|
+
background: var(--xh-steps-indicator-bg-completed-hover, var(--xh-_steps-host-bg-hover));
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
[data-scope='steps'][data-part='trigger']:not([data-disabled]):is(:active, [data-pressed])
|
|
236
|
+
[data-scope='steps'][data-part='indicator']:is([data-state='incomplete'], [data-state='completed']) {
|
|
237
|
+
background: var(--xh-steps-indicator-bg-pressed, var(--xh-_steps-host-bg-pressed));
|
|
238
|
+
transition-duration: var(--xh-motion-duration-press);
|
|
239
|
+
transition-timing-function: var(--xh-motion-ease-press);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
[data-scope='steps'][data-part='trigger']:not([data-disabled]):is(:active, [data-pressed])
|
|
243
|
+
[data-scope='steps'][data-part='indicator'][data-state='current'] {
|
|
244
|
+
background: var(--xh-steps-indicator-bg-current-pressed, var(--xh-_tone-active, var(--xh-bg-brand-active)));
|
|
245
|
+
transition-duration: var(--xh-motion-duration-press);
|
|
246
|
+
transition-timing-function: var(--xh-motion-ease-press);
|
|
247
|
+
}
|
|
248
|
+
|
|
177
249
|
[data-scope='steps'][data-part='indicator'][data-state='current'] {
|
|
178
250
|
border-color: var(--xh-steps-indicator-border-current, var(--xh-_steps-accent));
|
|
179
|
-
|
|
251
|
+
background: var(--xh-steps-indicator-bg-current, var(--xh-_steps-accent));
|
|
252
|
+
color: var(--xh-steps-indicator-fg-current, var(--xh-_steps-on-accent));
|
|
253
|
+
box-shadow: var(--xh-steps-indicator-shadow, var(--xh-_steps-highlight));
|
|
180
254
|
}
|
|
181
255
|
|
|
256
|
+
/* 走过的步:中性淡底(透明边位,§8.3)承一枚品牌色对号;标了语气的步对号跟语气的前景走 */
|
|
182
257
|
[data-scope='steps'][data-part='indicator'][data-state='completed'] {
|
|
183
|
-
border-color: var(--xh-steps-indicator-border-completed,
|
|
184
|
-
background: var(--xh-steps-indicator-bg-completed, var(--xh-
|
|
185
|
-
color: var(--xh-steps-indicator-fg-completed, var(--xh-_steps-
|
|
258
|
+
border-color: var(--xh-steps-indicator-border-completed, transparent);
|
|
259
|
+
background: var(--xh-steps-indicator-bg-completed, var(--xh-bg-subtle));
|
|
260
|
+
color: var(--xh-steps-indicator-fg-completed, var(--xh-_steps-accent-mark));
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* 单步语气:tones / collection 给某一步标了 data-tone,四个强调槽在这一步重新从语气层取值,
|
|
264
|
+
它的标记、标题与连接线照旧从祖先继承——只有这一步换色,状态那一档照算 */
|
|
265
|
+
[data-scope='steps'][data-part='item'][data-tone] {
|
|
266
|
+
--xh-_steps-accent: var(--xh-_tone);
|
|
267
|
+
--xh-_steps-accent-text: var(--xh-_tone-fg);
|
|
268
|
+
--xh-_steps-accent-mark: var(--xh-_tone-fg);
|
|
269
|
+
--xh-_steps-on-accent: var(--xh-_tone-on);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/* 标了语气的那一步还没走到也得被看见:空心描边加同色数字,不动实心那档的内高光 */
|
|
273
|
+
[data-scope='steps'][data-part='item'][data-tone]
|
|
274
|
+
[data-scope='steps'][data-part='indicator'][data-state='incomplete'] {
|
|
275
|
+
border-color: var(--xh-steps-indicator-border-toned, var(--xh-_steps-accent));
|
|
276
|
+
background: var(--xh-steps-indicator-bg-toned, var(--xh-_tone-subtle));
|
|
277
|
+
color: var(--xh-steps-indicator-fg-toned, var(--xh-_steps-accent-text));
|
|
186
278
|
}
|
|
187
279
|
|
|
188
280
|
[data-scope='steps'][data-part='item'][data-disabled] [data-scope='steps'][data-part='indicator'] {
|
|
189
|
-
border-color: var(--xh-steps-indicator-border-disabled, var(--xh-border-
|
|
281
|
+
border-color: var(--xh-steps-indicator-border-disabled, var(--xh-border-default));
|
|
282
|
+
background: var(--xh-steps-indicator-bg-disabled, var(--xh-bg-muted));
|
|
190
283
|
color: var(--xh-steps-indicator-fg-disabled, var(--xh-fg-disabled));
|
|
284
|
+
/* 这一步动不了,实心那档的内高光跟着收掉 */
|
|
285
|
+
box-shadow: none;
|
|
191
286
|
}
|
|
192
287
|
|
|
193
288
|
/* 标题与说明都在右列:不给 display,网格布局会替它们块级化,
|
|
@@ -204,14 +299,20 @@
|
|
|
204
299
|
}
|
|
205
300
|
|
|
206
301
|
[data-scope='steps'][data-part='title']:is([data-state='current'], [data-state='completed']) {
|
|
207
|
-
color: var(--xh-steps-title-fg-active, var(--xh-
|
|
302
|
+
color: var(--xh-steps-title-fg-active, var(--xh-_steps-accent-text));
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/* 标了语气的那一步标题跟着换色,不论走到没走到 */
|
|
306
|
+
[data-scope='steps'][data-part='item'][data-tone] [data-scope='steps'][data-part='title'] {
|
|
307
|
+
color: var(--xh-steps-title-fg-toned, var(--xh-_steps-accent-text));
|
|
208
308
|
}
|
|
209
309
|
|
|
310
|
+
/* 说明走说明角色(§6.4):13 / fg-muted / leading-normal,不随 size 档 */
|
|
210
311
|
[data-scope='steps'][data-part='description'] {
|
|
211
312
|
grid-column: 2;
|
|
212
|
-
color: var(--xh-steps-description-fg, var(--xh-fg-
|
|
213
|
-
font-size: var(--xh-steps-description-font-size, var(--xh-
|
|
214
|
-
line-height: var(--xh-leading-
|
|
313
|
+
color: var(--xh-steps-description-fg, var(--xh-fg-muted));
|
|
314
|
+
font-size: var(--xh-steps-description-font-size, var(--xh-text-secondary-size));
|
|
315
|
+
line-height: var(--xh-leading-normal);
|
|
215
316
|
overflow: hidden;
|
|
216
317
|
white-space: nowrap;
|
|
217
318
|
text-overflow: ellipsis;
|
|
@@ -239,7 +340,8 @@
|
|
|
239
340
|
[data-scope='steps'][data-part='separator'][data-orientation='vertical'] {
|
|
240
341
|
flex: none;
|
|
241
342
|
inline-size: var(--xh-steps-separator-thickness, var(--xh-stroke-thick));
|
|
242
|
-
|
|
343
|
+
min-inline-size: var(--xh-steps-separator-thickness, var(--xh-stroke-thick));
|
|
344
|
+
block-size: var(--xh-steps-separator-min-length, var(--xh-space-7));
|
|
243
345
|
/* 圆点半径减去线宽的一半:calc 里的除法要写成乘 0.5,除号在这儿是无效语法 */
|
|
244
346
|
margin-inline-start: calc(
|
|
245
347
|
var(--xh-steps-indicator-size, var(--xh-_steps-indicator-size)) * 0.5
|
|
@@ -255,20 +357,52 @@
|
|
|
255
357
|
color: var(--xh-steps-content-fg, var(--xh-fg-default));
|
|
256
358
|
}
|
|
257
359
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
outline-offset: var(--xh-ring-offset);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
/* 没写内容就由皮肤画兜底字形;作者往部件里塞了自己的图形,这几条即不命中 */
|
|
360
|
+
/* 没写内容就由皮肤画兜底对号;作者往部件里塞了自己的图形,这几条即不命中。
|
|
361
|
+
尺寸读圆点自己改接过的 --xh-icon-size:指示符档,随密度换档(见圆点块) */
|
|
264
362
|
[data-scope='steps'][data-part='indicator'][data-state='completed']:empty::before {
|
|
265
363
|
content: '';
|
|
266
364
|
display: inline-block;
|
|
267
|
-
inline-size: var(--xh-icon-size, var(--xh-glyph-size-
|
|
268
|
-
block-size: var(--xh-icon-size, var(--xh-glyph-size-
|
|
365
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-sm));
|
|
366
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-sm));
|
|
269
367
|
vertical-align: var(--xh-glyph-baseline-shift);
|
|
270
368
|
background-color: currentColor;
|
|
271
369
|
-webkit-mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
272
370
|
mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
273
371
|
}
|
|
372
|
+
|
|
373
|
+
@media (forced-colors: active) {
|
|
374
|
+
/* 触发器的悬停 / 按下由家族 forced-colors 块涂成 Highlight / HighlightText;标题与说明各自写了颜色,
|
|
375
|
+
这一档里会被换成 CanvasText 压在高亮底上,悬停与按住时一起跟到反色 */
|
|
376
|
+
[data-scope='steps'][data-part='trigger']:not([data-disabled]):is(:hover, :active, [data-pressed])
|
|
377
|
+
:is([data-scope='steps'][data-part='title'], [data-scope='steps'][data-part='description']) {
|
|
378
|
+
color: HighlightText;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
[data-scope='steps'][data-part='trigger']:hover:not([data-disabled])
|
|
382
|
+
[data-scope='steps'][data-part='indicator'][data-state='incomplete'] {
|
|
383
|
+
border-color: Highlight;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/* 连接线画的是一块纯底色,这一档里底色被统一换成 Canvas,整条进度线消失,
|
|
387
|
+
只剩一排孤立的圆点。走过的那几截换成系统高亮色,其余换成前景色 */
|
|
388
|
+
[data-scope='steps'][data-part='separator'] {
|
|
389
|
+
background: CanvasText;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
[data-scope='steps'][data-part='separator'][data-state='completed'] {
|
|
393
|
+
background: Highlight;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
@media print {
|
|
398
|
+
/* 打印默认丢背景:走过那几步的实心底与里面那枚勾都印不出来,
|
|
399
|
+
当前步与走过的步只剩一模一样的一圈细描边。改用描边的粗细与字重表达同一件事 */
|
|
400
|
+
[data-scope='steps'][data-part='indicator']:is([data-state='current'], [data-state='completed']) {
|
|
401
|
+
border-width: var(--xh-stroke-thick);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
[data-scope='steps'][data-part='title'][data-state='current'] {
|
|
405
|
+
font-weight: var(--xh-font-weight-semibold);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
274
408
|
}
|