@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
|
@@ -0,0 +1,513 @@
|
|
|
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
|
+
/* 定义 question flow 样式。 */
|
|
7
|
+
|
|
8
|
+
/* 共享关键帧由 family/motion.css 提供,本皮肤 @import 它,单独引入仍成立;
|
|
9
|
+
独立皮肤同时传递引入选项行与四颗钮的动作控件配方,full bundle 递归去重。 */
|
|
10
|
+
@import '../family/motion.css';
|
|
11
|
+
@import '../family/action-control.css';
|
|
12
|
+
|
|
13
|
+
@layer xihan.components {
|
|
14
|
+
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
15
|
+
[data-scope='question-flow'] {
|
|
16
|
+
--xh-question-flow-skin: 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* 一张静态内容面:--xh-border-default 描边 + surface 底 + 无影(§5.3 边界只由描边承担)。
|
|
20
|
+
三个视觉轴都落在 root 上:形态管底与描边怎么画,语气管用哪族颜色,尺寸管内衬、按钮高度与字号 */
|
|
21
|
+
[data-scope='question-flow'][data-part='root'] {
|
|
22
|
+
/* 作者塞进翻页钮的图标按档取尺(§6.5),与皮肤画的兜底字形同一把尺 */
|
|
23
|
+
--xh-icon-size: var(--xh-question-flow-icon-size, var(--xh-glyph-size-md));
|
|
24
|
+
/* 尺寸缺省档:不写 data-size 时按中档走 */
|
|
25
|
+
--xh-_question-flow-p: var(--xh-space-4);
|
|
26
|
+
--xh-_question-flow-gap: var(--xh-space-3);
|
|
27
|
+
--xh-_question-flow-h: var(--xh-control-h-md);
|
|
28
|
+
--xh-_question-flow-px: var(--xh-control-px-md);
|
|
29
|
+
--xh-_question-flow-font-size: var(--xh-control-font-md);
|
|
30
|
+
--xh-_question-flow-indicator: var(--xh-control-indicator-md);
|
|
31
|
+
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
gap: var(--xh-question-flow-gap, var(--xh-_question-flow-gap));
|
|
35
|
+
padding: var(--xh-question-flow-padding, var(--xh-_question-flow-p));
|
|
36
|
+
border: var(--xh-stroke-thin) solid var(--xh-question-flow-border, var(--xh-border-default));
|
|
37
|
+
border-radius: var(--xh-question-flow-radius, var(--xh-shape-surface));
|
|
38
|
+
background: var(--xh-question-flow-bg, var(--xh-bg-surface));
|
|
39
|
+
box-shadow: var(--xh-question-flow-shadow, none);
|
|
40
|
+
animation: xh-question-flow-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* 上面声明的 display 会盖掉 UA 的 [hidden]{display:none},这里补回 */
|
|
44
|
+
[data-scope='question-flow'][data-part='root'][hidden] {
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* —— 形态 —— */
|
|
49
|
+
/* 描边式是缺省档,写在上面那条基础规则里 */
|
|
50
|
+
/* 填充式:底色顶替描边表达边界。描边只退成透明而不去掉,
|
|
51
|
+
1px 的位置留着,与 outline 档并排时基线对得上;
|
|
52
|
+
淡底承载面向选项行与几颗中性钮下发 hover 200 → pressed 300(§7.2) */
|
|
53
|
+
[data-scope='question-flow'][data-part='root'][data-variant='subtle'] {
|
|
54
|
+
--xh-action-host-bg-hover: var(--xh-bg-subtle-hover);
|
|
55
|
+
--xh-action-host-bg-pressed: var(--xh-bg-subtle-active);
|
|
56
|
+
|
|
57
|
+
border-color: transparent;
|
|
58
|
+
background: var(--xh-question-flow-bg, var(--xh-_tone-subtle, var(--xh-bg-subtle)));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* 无壳:底与描边都透明,影一并收掉——底都不画了,一圈投影就成了没有来处的暗边 */
|
|
62
|
+
[data-scope='question-flow'][data-part='root'][data-variant='ghost'] {
|
|
63
|
+
border-color: transparent;
|
|
64
|
+
background: transparent;
|
|
65
|
+
box-shadow: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* —— 尺寸 —— */
|
|
69
|
+
[data-scope='question-flow'][data-part='root'][data-size='sm'] {
|
|
70
|
+
--xh-_question-flow-p: var(--xh-space-3);
|
|
71
|
+
--xh-_question-flow-gap: var(--xh-space-2);
|
|
72
|
+
--xh-_question-flow-h: var(--xh-control-h-sm);
|
|
73
|
+
--xh-_question-flow-px: var(--xh-control-px-sm);
|
|
74
|
+
--xh-_question-flow-font-size: var(--xh-control-font-sm);
|
|
75
|
+
--xh-_question-flow-indicator: var(--xh-control-indicator-sm);
|
|
76
|
+
--xh-icon-size: var(--xh-question-flow-icon-size, var(--xh-glyph-size-sm));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[data-scope='question-flow'][data-part='root'][data-size='md'] {
|
|
80
|
+
--xh-_question-flow-p: var(--xh-space-4);
|
|
81
|
+
--xh-_question-flow-gap: var(--xh-space-3);
|
|
82
|
+
--xh-_question-flow-h: var(--xh-control-h-md);
|
|
83
|
+
--xh-_question-flow-px: var(--xh-control-px-md);
|
|
84
|
+
--xh-_question-flow-font-size: var(--xh-control-font-md);
|
|
85
|
+
--xh-_question-flow-indicator: var(--xh-control-indicator-md);
|
|
86
|
+
--xh-icon-size: var(--xh-question-flow-icon-size, var(--xh-glyph-size-md));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
[data-scope='question-flow'][data-part='root'][data-size='lg'] {
|
|
90
|
+
--xh-_question-flow-p: var(--xh-space-5);
|
|
91
|
+
--xh-_question-flow-gap: var(--xh-space-4);
|
|
92
|
+
--xh-_question-flow-h: var(--xh-control-h-lg);
|
|
93
|
+
--xh-_question-flow-px: var(--xh-control-px-lg);
|
|
94
|
+
--xh-_question-flow-font-size: var(--xh-control-font-lg);
|
|
95
|
+
--xh-_question-flow-indicator: var(--xh-control-indicator-lg);
|
|
96
|
+
--xh-icon-size: var(--xh-question-flow-icon-size, var(--xh-glyph-size-lg));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* 视口定高并裁切:高度由机器量出来写进私有槽,量到之前按内容撑开。
|
|
100
|
+
换题时高度过渡到新那一题,卡片跟着长高或收矮 */
|
|
101
|
+
[data-scope='question-flow'][data-part='viewport'] {
|
|
102
|
+
--xh-_question-flow-viewport-h: auto;
|
|
103
|
+
|
|
104
|
+
display: block;
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
block-size: var(--xh-question-flow-viewport-h, var(--xh-_question-flow-viewport-h));
|
|
107
|
+
transition: block-size var(--xh-motion-duration-enter) var(--xh-motion-ease-continuous);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
[data-scope='question-flow'][data-part='viewport'][hidden] {
|
|
111
|
+
display: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* 轨道把全部题目纵向排开,靠位移把当前题推进视口 */
|
|
115
|
+
[data-scope='question-flow'][data-part='track'] {
|
|
116
|
+
--xh-_question-flow-track-y: 0;
|
|
117
|
+
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-direction: column;
|
|
120
|
+
gap: var(--xh-question-flow-track-gap, var(--xh-_question-flow-gap));
|
|
121
|
+
translate: 0 var(--xh-question-flow-track-y, var(--xh-_question-flow-track-y));
|
|
122
|
+
transition: translate var(--xh-motion-duration-enter) var(--xh-motion-ease-continuous);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
[data-scope='question-flow'][data-part='track'][hidden] {
|
|
126
|
+
display: none;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* 一题的整块。非当前题淡出并让开指针:它仍留在轨道上,高度才有得可量 */
|
|
130
|
+
[data-scope='question-flow'][data-part='question'] {
|
|
131
|
+
display: flex;
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
gap: var(--xh-question-flow-question-gap, var(--xh-space-2));
|
|
134
|
+
opacity: 0;
|
|
135
|
+
pointer-events: none;
|
|
136
|
+
transition: opacity var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
[data-scope='question-flow'][data-part='question'][hidden] {
|
|
140
|
+
display: none;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
[data-scope='question-flow'][data-part='question'][data-current] {
|
|
144
|
+
opacity: 1;
|
|
145
|
+
pointer-events: auto;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* 题干就是这一题的标题,也是选项组的可访问名:走 Surface 标题档 14/600(§6.4) */
|
|
149
|
+
[data-scope='question-flow'][data-part='prompt'] {
|
|
150
|
+
display: block;
|
|
151
|
+
margin: 0;
|
|
152
|
+
color: var(--xh-question-flow-prompt-fg, var(--xh-fg-default));
|
|
153
|
+
font-size: var(--xh-question-flow-prompt-font-size, var(--xh-text-label-size));
|
|
154
|
+
font-weight: var(--xh-question-flow-prompt-font-weight, var(--xh-font-weight-semibold));
|
|
155
|
+
line-height: var(--xh-leading-tight);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
[data-scope='question-flow'][data-part='prompt'][hidden] {
|
|
159
|
+
display: none;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
[data-scope='question-flow'][data-part='group'] {
|
|
163
|
+
display: flex;
|
|
164
|
+
flex-direction: column;
|
|
165
|
+
gap: var(--xh-question-flow-group-gap, var(--xh-space-1));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
[data-scope='question-flow'][data-part='group'][hidden] {
|
|
169
|
+
display: none;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* 一个选项:整行可点、可聚焦,记号在左。盒型、悬停 / 按下 / 禁用面由 Action Control 的 row 档给
|
|
173
|
+
(ghost 形态:白底承载 hover 100 → pressed 200,按下只换面不缩放,§9.2;禁用守卫认 data-disabled),
|
|
174
|
+
这里只把使用者槽映射到桥接槽,内衬与间距沿用本组件的档位;字色三态同一支,选中档在下面换一档。
|
|
175
|
+
行高不吃家族的单行档:row 档允许换行、高度随内容,一条会折行的选项文案走正文行高(§6.4) */
|
|
176
|
+
[data-scope='question-flow'][data-part='item'] {
|
|
177
|
+
--xh-action-gap: var(--xh-question-flow-item-gap, var(--xh-space-1_5));
|
|
178
|
+
--xh-action-padding-inline: var(--xh-question-flow-item-px, var(--xh-space-2));
|
|
179
|
+
--xh-action-padding-block: var(--xh-question-flow-item-py, var(--xh-space-1));
|
|
180
|
+
--xh-action-radius: var(--xh-question-flow-item-radius, var(--xh-_action-profile-radius));
|
|
181
|
+
--xh-action-font-size: var(--xh-question-flow-item-font-size, var(--xh-_question-flow-font-size));
|
|
182
|
+
--xh-action-bg-rest: var(--xh-question-flow-item-bg, var(--xh-_action-variant-bg-rest));
|
|
183
|
+
--xh-action-bg-hover: var(--xh-question-flow-item-bg-hover, var(--xh-_action-variant-bg-hover));
|
|
184
|
+
--xh-action-fg-rest: var(--xh-question-flow-item-fg, var(--xh-fg-muted));
|
|
185
|
+
--xh-action-fg-hover: var(--xh-question-flow-item-fg, var(--xh-fg-muted));
|
|
186
|
+
--xh-action-fg-pressed: var(--xh-question-flow-item-fg, var(--xh-fg-muted));
|
|
187
|
+
|
|
188
|
+
line-height: var(--xh-leading-normal);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
[data-scope='question-flow'][data-part='item'][hidden] {
|
|
192
|
+
display: none;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* 当前题的选项按位次错开开幕,换题时随 data-current 重跑。
|
|
196
|
+
backwards 不能省:等待期间起帧不生效的话,后面几条会先露一下再跳回去。
|
|
197
|
+
第 6 条起并到同一拍上 */
|
|
198
|
+
[data-scope='question-flow'][data-part='question'][data-current] [data-part='item'] {
|
|
199
|
+
animation: xh-rise-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong) backwards;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
[data-scope='question-flow'][data-part='question'][data-current] [data-part='item']:nth-child(2) {
|
|
203
|
+
animation-delay: calc(var(--xh-motion-stagger-step) * 1);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
[data-scope='question-flow'][data-part='question'][data-current] [data-part='item']:nth-child(3) {
|
|
207
|
+
animation-delay: calc(var(--xh-motion-stagger-step) * 2);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
[data-scope='question-flow'][data-part='question'][data-current] [data-part='item']:nth-child(4) {
|
|
211
|
+
animation-delay: calc(var(--xh-motion-stagger-step) * 3);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
[data-scope='question-flow'][data-part='question'][data-current] [data-part='item']:nth-child(5) {
|
|
215
|
+
animation-delay: calc(var(--xh-motion-stagger-step) * 4);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
[data-scope='question-flow'][data-part='question'][data-current] [data-part='item']:nth-child(n + 6) {
|
|
219
|
+
animation-delay: calc(var(--xh-motion-stagger-step) * 5);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* 选中的那条读起来更重一档(禁用项无论选没选都是家族给的禁用色) */
|
|
223
|
+
[data-scope='question-flow'][data-part='item'][data-state='checked'] {
|
|
224
|
+
--xh-action-fg-rest: var(--xh-question-flow-item-fg-checked, var(--xh-fg-default));
|
|
225
|
+
--xh-action-fg-hover: var(--xh-question-flow-item-fg-checked, var(--xh-fg-default));
|
|
226
|
+
--xh-action-fg-pressed: var(--xh-question-flow-item-fg-checked, var(--xh-fg-default));
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* 记号盒:多选是圆角方格,单选是圆。选中态填色,纯装饰不进可访问名 */
|
|
230
|
+
[data-scope='question-flow'][data-part='item-indicator'] {
|
|
231
|
+
/* 盒里那枚记号按盒比例量(与 Checkbox 同一比例),作者塞进来的图标读同一把尺。
|
|
232
|
+
根上那把是展示型图标档,比指示符盒还大一档,画进这个盒里会溢出四个像素 */
|
|
233
|
+
--xh-_question-flow-indicator-glyph: calc(var(--xh-question-flow-indicator-size, var(--xh-_question-flow-indicator)) * 0.75);
|
|
234
|
+
--xh-icon-size: var(--xh-question-flow-indicator-icon-size, var(--xh-_question-flow-indicator-glyph));
|
|
235
|
+
|
|
236
|
+
display: inline-flex;
|
|
237
|
+
flex: none;
|
|
238
|
+
align-items: center;
|
|
239
|
+
justify-content: center;
|
|
240
|
+
border: var(--xh-stroke-thin) solid var(--xh-question-flow-indicator-border, var(--xh-border-control));
|
|
241
|
+
border-radius: var(--xh-question-flow-indicator-radius, var(--xh-shape-inset));
|
|
242
|
+
background: var(--xh-question-flow-indicator-bg, transparent);
|
|
243
|
+
color: var(--xh-question-flow-indicator-fg, var(--xh-_tone-on, var(--xh-fg-on-brand)));
|
|
244
|
+
inline-size: var(--xh-question-flow-indicator-size, var(--xh-_question-flow-indicator));
|
|
245
|
+
block-size: var(--xh-question-flow-indicator-size, var(--xh-_question-flow-indicator));
|
|
246
|
+
transition:
|
|
247
|
+
background var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
248
|
+
border-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
249
|
+
color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
[data-scope='question-flow'][data-part='item-indicator'][hidden] {
|
|
253
|
+
display: none;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/* 单选那一档把方格收成圆:正方盒取 circle(§6.3) */
|
|
257
|
+
[data-scope='question-flow'][data-part='item-indicator'][data-select-mode='single'] {
|
|
258
|
+
border-radius: var(--xh-question-flow-indicator-radius-single, var(--xh-shape-circle));
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/* 没写内容就由皮肤画勾;作者往部件里塞了自己的图形,这条规则即不命中 */
|
|
262
|
+
[data-scope='question-flow'][data-part='item-indicator']:empty::before {
|
|
263
|
+
content: '';
|
|
264
|
+
display: inline-block;
|
|
265
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
266
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
267
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
268
|
+
background-color: currentColor;
|
|
269
|
+
-webkit-mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
270
|
+
mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/* 单选那一档把勾换成实心点:mask 撤掉,圆点由伪元素自己的底色画。
|
|
274
|
+
直径按记号盒的一半量,与其余单选控件的圆点同源——盒换档时点跟着换 */
|
|
275
|
+
[data-scope='question-flow'][data-part='item-indicator'][data-select-mode='single']:empty::before {
|
|
276
|
+
inline-size: var(--xh-question-flow-dot-size, calc(var(--xh-question-flow-indicator-size, var(--xh-_question-flow-indicator)) / 2));
|
|
277
|
+
block-size: var(--xh-question-flow-dot-size, calc(var(--xh-question-flow-indicator-size, var(--xh-_question-flow-indicator)) / 2));
|
|
278
|
+
border-radius: var(--xh-question-flow-dot-radius, var(--xh-shape-circle));
|
|
279
|
+
-webkit-mask: none;
|
|
280
|
+
mask: none;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
[data-scope='question-flow'][data-part='item-indicator'][data-state='checked'] {
|
|
284
|
+
border-color: var(--xh-question-flow-indicator-border-checked, var(--xh-_tone, var(--xh-bg-brand)));
|
|
285
|
+
background: var(--xh-question-flow-indicator-bg-checked, var(--xh-_tone, var(--xh-bg-brand)));
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/* 没选中时把记号隐去而不是撤掉:盒留在原位,翻面时整行不跳 */
|
|
289
|
+
[data-scope='question-flow'][data-part='item-indicator'][data-state='unchecked'] {
|
|
290
|
+
color: transparent;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
[data-scope='question-flow'][data-part='item-text'] {
|
|
294
|
+
display: block;
|
|
295
|
+
flex: 1 1 auto;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
[data-scope='question-flow'][data-part='item-text'][hidden] {
|
|
299
|
+
display: none;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/* 自由文本:与选项同等算数的一条答案,占满整行 */
|
|
303
|
+
[data-scope='question-flow'][data-part='note'] {
|
|
304
|
+
display: block;
|
|
305
|
+
inline-size: 100%;
|
|
306
|
+
padding-inline: var(--xh-question-flow-note-px, var(--xh-space-2));
|
|
307
|
+
padding-block: var(--xh-question-flow-note-py, var(--xh-space-1_5));
|
|
308
|
+
border: var(--xh-stroke-thin) solid var(--xh-question-flow-note-border, var(--xh-border-control));
|
|
309
|
+
border-radius: var(--xh-question-flow-note-radius, var(--xh-shape-control));
|
|
310
|
+
background: var(--xh-question-flow-note-bg, var(--xh-bg-surface));
|
|
311
|
+
color: var(--xh-question-flow-note-fg, var(--xh-fg-default));
|
|
312
|
+
font-family: inherit;
|
|
313
|
+
font-size: var(--xh-question-flow-note-font-size, var(--xh-_question-flow-font-size));
|
|
314
|
+
transition: border-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
[data-scope='question-flow'][data-part='note'][hidden] {
|
|
318
|
+
display: none;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
[data-scope='question-flow'][data-part='note']::placeholder {
|
|
322
|
+
color: var(--xh-question-flow-placeholder-fg, var(--xh-fg-subtle));
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
[data-scope='question-flow'][data-part='note']:disabled {
|
|
326
|
+
color: var(--xh-fg-disabled);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/* 页脚:左边步进,右边动作。
|
|
330
|
+
两侧的钮都不收缩、文案也不折行,一行摆不下时整条页脚顶出卡片;
|
|
331
|
+
允许换行后摆不下的那一组落到下一行 */
|
|
332
|
+
[data-scope='question-flow'][data-part='footer'] {
|
|
333
|
+
display: flex;
|
|
334
|
+
flex-wrap: wrap;
|
|
335
|
+
align-items: center;
|
|
336
|
+
justify-content: space-between;
|
|
337
|
+
gap: var(--xh-question-flow-footer-gap, var(--xh-space-3));
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
[data-scope='question-flow'][data-part='footer'][hidden] {
|
|
341
|
+
display: none;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/* 两颗翻页钮是方形图标钮,中间夹着计数:盒几何、悬停 / 按下与 0.97 按压、焦点环、禁用面全由
|
|
345
|
+
Action Control 的 icon 档 xs 位给(24px = --xh-control-action-size;ghost 形态,白底 100 → 200),
|
|
346
|
+
组件只映射既有使用者槽:尺寸、内衬、圆角(inset)、底与字色 */
|
|
347
|
+
[data-scope='question-flow'][data-part='prev-trigger'],
|
|
348
|
+
[data-scope='question-flow'][data-part='next-trigger'] {
|
|
349
|
+
--xh-action-visual-size: var(--xh-question-flow-step-size, var(--xh-_action-profile-visual-size));
|
|
350
|
+
--xh-action-padding-inline: var(--xh-question-flow-step-padding, var(--xh-_action-profile-padding-inline));
|
|
351
|
+
--xh-action-radius: var(--xh-question-flow-step-radius, var(--xh-shape-inset));
|
|
352
|
+
--xh-action-bg-rest: var(--xh-question-flow-step-bg, var(--xh-_action-variant-bg-rest));
|
|
353
|
+
--xh-action-bg-hover: var(--xh-question-flow-step-bg-hover, var(--xh-_action-variant-bg-hover));
|
|
354
|
+
--xh-action-fg-rest: var(--xh-question-flow-step-fg, var(--xh-fg-subtle));
|
|
355
|
+
--xh-action-fg-hover: var(--xh-question-flow-step-fg-hover, var(--xh-fg-default));
|
|
356
|
+
--xh-action-fg-pressed: var(--xh-question-flow-step-fg-hover, var(--xh-fg-default));
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/* 家族那条 display 会把 UA 的 [hidden]{display:none} 盖掉 */
|
|
360
|
+
[data-scope='question-flow'][data-part='prev-trigger'][hidden],
|
|
361
|
+
[data-scope='question-flow'][data-part='next-trigger'][hidden] {
|
|
362
|
+
display: none;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/* 没写内容就由皮肤画箭头;作者往按钮里塞了自己的图形,这两条即不命中 */
|
|
366
|
+
[data-scope='question-flow'][data-part='prev-trigger']:empty::before {
|
|
367
|
+
content: '';
|
|
368
|
+
display: inline-block;
|
|
369
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
370
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
371
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
372
|
+
background-color: currentColor;
|
|
373
|
+
-webkit-mask: var(--xh-glyph-mark-chevron-up) center / contain no-repeat;
|
|
374
|
+
mask: var(--xh-glyph-mark-chevron-up) center / contain no-repeat;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
[data-scope='question-flow'][data-part='next-trigger']:empty::before {
|
|
378
|
+
content: '';
|
|
379
|
+
display: inline-block;
|
|
380
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
381
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
382
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
383
|
+
background-color: currentColor;
|
|
384
|
+
-webkit-mask: var(--xh-glyph-mark-chevron-down) center / contain no-repeat;
|
|
385
|
+
mask: var(--xh-glyph-mark-chevron-down) center / contain no-repeat;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/* 给眼睛看的 N / M:等宽数字,换题时不左右晃 */
|
|
389
|
+
[data-scope='question-flow'][data-part='counter'] {
|
|
390
|
+
display: inline-flex;
|
|
391
|
+
align-items: center;
|
|
392
|
+
color: var(--xh-question-flow-counter-fg, var(--xh-fg-subtle));
|
|
393
|
+
font-size: var(--xh-question-flow-counter-font-size, var(--xh-text-caption-size));
|
|
394
|
+
font-variant-numeric: tabular-nums;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
[data-scope='question-flow'][data-part='counter'][hidden] {
|
|
398
|
+
display: none;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/* 两颗动作钮是离散动作控件:盒几何、悬停 / 按下与 0.97 按压、焦点环、禁用面全由 Action Control 的 text 档给,
|
|
402
|
+
组件只映射既有使用者槽。跳过走 ghost 档:安静的文字钮(白底 100 → 200);提交走 solid 档:这一组里的主要动作,
|
|
403
|
+
与 Button 缺省同为品牌实心。两颗共用的几何与字号写在一起 */
|
|
404
|
+
[data-scope='question-flow'][data-part='skip-trigger'],
|
|
405
|
+
[data-scope='question-flow'][data-part='submit-trigger'] {
|
|
406
|
+
--xh-action-gap: var(--xh-question-flow-action-gap, var(--xh-space-1));
|
|
407
|
+
--xh-action-visual-size: var(--xh-question-flow-action-h, var(--xh-_question-flow-h));
|
|
408
|
+
--xh-action-padding-inline: var(--xh-question-flow-action-px, var(--xh-_question-flow-px));
|
|
409
|
+
--xh-action-radius: var(--xh-question-flow-action-radius, var(--xh-shape-control));
|
|
410
|
+
--xh-action-font-size: var(--xh-question-flow-action-font-size, var(--xh-text-label-size));
|
|
411
|
+
|
|
412
|
+
font-weight: var(--xh-question-flow-action-font-weight, var(--xh-text-label-weight));
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/* 家族那条 display 会把 UA 的 [hidden]{display:none} 盖掉 */
|
|
416
|
+
[data-scope='question-flow'][data-part='skip-trigger'][hidden],
|
|
417
|
+
[data-scope='question-flow'][data-part='submit-trigger'][hidden] {
|
|
418
|
+
display: none;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/* 跳过钮:底与字色映到 ghost 档的桥接槽,悬停时字色提到正文档 */
|
|
422
|
+
[data-scope='question-flow'][data-part='skip-trigger'] {
|
|
423
|
+
--xh-action-bg-rest: var(--xh-question-flow-skip-bg, var(--xh-_action-variant-bg-rest));
|
|
424
|
+
--xh-action-bg-hover: var(--xh-question-flow-skip-bg-hover, var(--xh-_action-variant-bg-hover));
|
|
425
|
+
--xh-action-fg-rest: var(--xh-question-flow-skip-fg, var(--xh-fg-muted));
|
|
426
|
+
--xh-action-fg-hover: var(--xh-question-flow-skip-fg-hover, var(--xh-fg-default));
|
|
427
|
+
--xh-action-fg-pressed: var(--xh-question-flow-skip-fg-hover, var(--xh-fg-default));
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/* 提交钮:品牌实心,内顶高光把实心块顶出一道边,与跳过那颗的描边同一档厚度(三态同一支,
|
|
431
|
+
答不动时的置灰面由家族收掉、高光随之撤掉,出口一直在那里只是按不动);底 / 字与置灰底映到 solid 档的桥接槽 */
|
|
432
|
+
[data-scope='question-flow'][data-part='submit-trigger'] {
|
|
433
|
+
--xh-action-bg-rest: var(--xh-question-flow-submit-bg, var(--xh-_action-variant-bg-rest));
|
|
434
|
+
--xh-action-bg-hover: var(--xh-question-flow-submit-bg-hover, var(--xh-_action-variant-bg-hover));
|
|
435
|
+
--xh-action-bg-pressed: var(--xh-question-flow-submit-bg-active, var(--xh-_action-variant-bg-pressed));
|
|
436
|
+
--xh-action-bg-disabled: var(--xh-question-flow-submit-bg-off, var(--xh-_action-variant-bg-disabled));
|
|
437
|
+
--xh-action-fg-rest: var(--xh-question-flow-submit-fg, var(--xh-_action-variant-fg-rest));
|
|
438
|
+
--xh-action-fg-hover: var(--xh-question-flow-submit-fg, var(--xh-_action-variant-fg-hover));
|
|
439
|
+
--xh-action-fg-pressed: var(--xh-question-flow-submit-fg, var(--xh-_action-variant-fg-pressed));
|
|
440
|
+
--xh-action-highlight-rest: transparent;
|
|
441
|
+
--xh-action-shadow-rest: var(--xh-question-flow-submit-shadow, var(--xh-_highlight-tone));
|
|
442
|
+
--xh-action-shadow-hover: var(--xh-question-flow-submit-shadow, var(--xh-_highlight-tone));
|
|
443
|
+
--xh-action-shadow-pressed: var(--xh-question-flow-submit-shadow, var(--xh-_highlight-tone));
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/* 面是实心的,环色与面同族,画在面里就看不出来;环改取面自己的前景色——
|
|
447
|
+
那一族色本来就要在这块面上把字读清楚,与面的对比是按可读性定的。
|
|
448
|
+
置灰档的底换成置灰底、字换成置灰色,环取过来就跟底一起糊了,那一档走公共层的环 */
|
|
449
|
+
[data-scope='question-flow'][data-part='submit-trigger']:not([data-disabled]) {
|
|
450
|
+
--xh-action-ring-color-focus-visible: currentColor;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/* 交卷之后才露出的那一格 */
|
|
454
|
+
[data-scope='question-flow'][data-part='result'] {
|
|
455
|
+
display: inline-flex;
|
|
456
|
+
align-self: flex-start;
|
|
457
|
+
align-items: center;
|
|
458
|
+
gap: var(--xh-question-flow-result-gap, var(--xh-space-1_5));
|
|
459
|
+
padding-inline: var(--xh-question-flow-result-px, var(--xh-space-2));
|
|
460
|
+
padding-block: var(--xh-question-flow-result-py, var(--xh-space-1));
|
|
461
|
+
border-radius: var(--xh-question-flow-result-radius, var(--xh-shape-pill));
|
|
462
|
+
background: var(--xh-question-flow-result-bg, var(--xh-bg-subtle));
|
|
463
|
+
color: var(--xh-question-flow-result-fg, var(--xh-fg-success));
|
|
464
|
+
font-size: var(--xh-question-flow-result-font-size, var(--xh-text-caption-size));
|
|
465
|
+
font-weight: var(--xh-question-flow-result-font-weight, var(--xh-text-label-weight));
|
|
466
|
+
animation: xh-question-flow-result-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
[data-scope='question-flow'][data-part='result'][hidden] {
|
|
470
|
+
display: none;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/* 视觉隐藏的播报区:不能 display:none,那样读屏就取不到它了 */
|
|
474
|
+
[data-scope='question-flow'][data-part='live-region'] {
|
|
475
|
+
position: absolute;
|
|
476
|
+
inline-size: 1px;
|
|
477
|
+
block-size: 1px;
|
|
478
|
+
padding: 0;
|
|
479
|
+
margin: -1px;
|
|
480
|
+
border: 0;
|
|
481
|
+
overflow: hidden;
|
|
482
|
+
clip-path: inset(50%);
|
|
483
|
+
white-space: nowrap;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
@layer xihan.motion {
|
|
488
|
+
/* 组件专属关键帧写在自己身上;共享的 xh-rise-in 由 family/motion.css 提供。 */
|
|
489
|
+
/* 幅度走令牌,减弱动效时由令牌层归零;位移用独立属性而非 transform 简写 */
|
|
490
|
+
@keyframes xh-question-flow-in {
|
|
491
|
+
from {
|
|
492
|
+
opacity: 0;
|
|
493
|
+
translate: 0 var(--xh-motion-distance-md);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
to {
|
|
497
|
+
opacity: 1;
|
|
498
|
+
translate: 0 0;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
@keyframes xh-question-flow-result-in {
|
|
503
|
+
from {
|
|
504
|
+
opacity: 0;
|
|
505
|
+
scale: var(--xh-motion-scale-enter);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
to {
|
|
509
|
+
opacity: 1;
|
|
510
|
+
scale: 1;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|