@xihan-ui/styles 3.0.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -0
- package/README.md +1 -1
- package/component-tokens.d.ts +29 -0
- package/components.tokens.json +683 -27
- package/css/alert.css +2 -2
- package/css/approval.css +4 -4
- package/css/button.css +9 -5
- package/css/calendar-picker.css +3 -3
- package/css/calendar-range-picker.css +7 -7
- package/css/carousel.css +45 -13
- package/css/cartesian-chart.css +11 -11
- package/css/cascader.css +10 -10
- package/css/citation.css +2 -2
- package/css/code-view.css +6 -6
- package/css/color-picker.css +81 -0
- package/css/color-swatch-picker.css +9 -4
- package/css/combobox.css +12 -4
- package/css/command.css +1 -1
- package/css/date-field.css +39 -0
- package/css/date-picker.css +86 -9
- package/css/date-range-picker.css +47 -7
- package/css/diff-view.css +8 -8
- package/css/field-array.css +1 -1
- package/css/field.css +4 -0
- package/css/file-upload.css +1 -1
- package/css/float-button.css +140 -27
- package/css/form.css +14 -6
- package/css/graph-chart.css +2 -2
- package/css/highlight.css +1 -1
- package/css/image.css +1 -1
- package/css/mention.css +1 -1
- package/css/message-feed.css +1 -1
- package/css/notification.css +26 -20
- package/css/number-field.css +18 -18
- package/css/page-header.css +2 -2
- package/css/password-input.css +2 -2
- package/css/popconfirm.css +3 -3
- package/css/question-flow.css +8 -8
- package/css/radar-chart.css +6 -6
- package/css/rating.css +1 -1
- package/css/select.css +2 -2
- package/css/separator.css +2 -2
- package/css/side-nav.css +13 -13
- package/css/skeleton.css +5 -5
- package/css/slider.css +6 -6
- package/css/sortable.css +2 -2
- package/css/table.css +19 -2
- package/css/tags-input.css +1 -1
- package/css/time-picker.css +59 -2
- package/css/tool-call.css +7 -7
- package/css/tooltip.css +1 -1
- package/css/tree-select.css +2 -2
- package/css/tree.css +81 -11
- package/dist/css/accordion.css +269 -0
- package/dist/css/affix.css +47 -0
- package/dist/css/alert.css +247 -0
- package/dist/css/anchor.css +252 -0
- package/dist/css/approval.css +501 -0
- package/dist/css/avatar-group.css +99 -0
- package/dist/css/avatar.css +98 -0
- package/dist/css/back-top.css +161 -0
- package/dist/css/badge.css +205 -0
- package/dist/css/bar-code.css +62 -0
- package/dist/css/breadcrumb.css +230 -0
- package/dist/css/button-group.css +263 -0
- package/dist/css/button.css +219 -0
- package/dist/css/calendar-picker.css +467 -0
- package/dist/css/calendar-range-picker.css +554 -0
- package/dist/css/card.css +221 -0
- package/dist/css/carousel.css +710 -0
- package/dist/css/cartesian-chart.css +830 -0
- package/dist/css/cascader.css +961 -0
- package/dist/css/checkbox-group.css +358 -0
- package/dist/css/checkbox.css +257 -0
- package/dist/css/citation.css +470 -0
- package/dist/css/clipboard.css +315 -0
- package/dist/css/code-view.css +374 -0
- package/dist/css/collapsible.css +185 -0
- package/dist/css/color-field.css +176 -0
- package/dist/css/color-picker.css +595 -0
- package/dist/css/color-slider.css +281 -0
- package/dist/css/color-swatch-picker.css +250 -0
- package/dist/css/color-swatch.css +35 -0
- package/dist/css/combobox.css +574 -0
- package/dist/css/command.css +399 -0
- package/dist/css/context-menu.css +420 -0
- package/dist/css/date-field.css +317 -0
- package/dist/css/date-picker.css +868 -0
- package/dist/css/date-range-picker.css +886 -0
- package/dist/css/description.css +67 -0
- package/dist/css/descriptions.css +299 -0
- package/dist/css/dialog.css +455 -0
- package/dist/css/diff-view.css +513 -0
- package/dist/css/download-trigger.css +151 -0
- package/dist/css/drawer.css +552 -0
- package/dist/css/editable.css +295 -0
- package/dist/css/empty-state.css +163 -0
- package/dist/css/field-array.css +226 -0
- package/dist/css/field.css +166 -0
- package/dist/css/fieldset.css +102 -0
- package/dist/css/file-upload.css +429 -0
- package/dist/css/flex.css +441 -0
- package/dist/css/float-button.css +569 -0
- package/dist/css/floating-panel.css +429 -0
- package/dist/css/focus.css +46 -0
- package/dist/css/forced-colors.css +93 -0
- package/dist/css/form.css +393 -0
- package/dist/css/funnel-chart.css +106 -0
- package/dist/css/graph-chart.css +205 -0
- package/dist/css/grid-list.css +235 -0
- package/dist/css/grid.css +1201 -0
- package/dist/css/heatmap.css +552 -0
- package/dist/css/hierarchy-chart.css +298 -0
- package/dist/css/highlight.css +41 -0
- package/dist/css/hover-card.css +226 -0
- package/dist/css/icon.css +225 -0
- package/dist/css/image-cropper.css +373 -0
- package/dist/css/image-viewer.css +538 -0
- package/dist/css/image.css +98 -0
- package/dist/css/infinite-scroll.css +77 -0
- package/dist/css/input-group.css +275 -0
- package/dist/css/json-viewer.css +379 -0
- package/dist/css/kbd.css +72 -0
- package/dist/css/label.css +78 -0
- package/dist/css/layers.css +7 -0
- package/dist/css/layout.css +372 -0
- package/dist/css/liquid.css +106 -0
- package/dist/css/list.css +152 -0
- package/dist/css/listbox.css +390 -0
- package/dist/css/loading-bar.css +141 -0
- package/dist/css/log.css +306 -0
- package/dist/css/markdown-stream.css +149 -0
- package/dist/css/marquee.css +378 -0
- package/dist/css/masonry.css +70 -0
- package/dist/css/matrix-code.css +67 -0
- package/dist/css/mention.css +393 -0
- package/dist/css/menu.css +364 -0
- package/dist/css/menubar.css +456 -0
- package/dist/css/message-feed.css +318 -0
- package/dist/css/navigation-menu.css +513 -0
- package/dist/css/notification.css +782 -0
- package/dist/css/number-animation.css +44 -0
- package/dist/css/number-field.css +252 -0
- package/dist/css/overlay-arrow.css +56 -0
- package/dist/css/page-header.css +184 -0
- package/dist/css/pagination.css +450 -0
- package/dist/css/password-input.css +391 -0
- package/dist/css/pie-chart.css +247 -0
- package/dist/css/pin-input.css +199 -0
- package/dist/css/pointer.css +36 -0
- package/dist/css/popconfirm.css +320 -0
- package/dist/css/popover.css +279 -0
- package/dist/css/progress.css +501 -0
- package/dist/css/prompt-input.css +260 -0
- package/dist/css/question-flow.css +553 -0
- package/dist/css/radar-chart.css +233 -0
- package/dist/css/radio-group.css +598 -0
- package/dist/css/rating.css +294 -0
- package/dist/css/reasoning.css +343 -0
- package/dist/css/reset.css +117 -0
- package/dist/css/resizable.css +242 -0
- package/dist/css/sankey-chart.css +174 -0
- package/dist/css/scroll-area.css +240 -0
- package/dist/css/scrollbar.css +204 -0
- package/dist/css/select.css +612 -0
- package/dist/css/separator.css +122 -0
- package/dist/css/side-nav.css +476 -0
- package/dist/css/signature-pad.css +179 -0
- package/dist/css/skeleton.css +161 -0
- package/dist/css/slider.css +374 -0
- package/dist/css/sortable.css +228 -0
- package/dist/css/sparkline.css +164 -0
- package/dist/css/spinner.css +236 -0
- package/dist/css/splitter.css +159 -0
- package/dist/css/statistic.css +137 -0
- package/dist/css/steps.css +627 -0
- package/dist/css/switch.css +351 -0
- package/dist/css/table.css +1145 -0
- package/dist/css/tabs.css +944 -0
- package/dist/css/tag-group.css +247 -0
- package/dist/css/tag.css +310 -0
- package/dist/css/tags-input.css +322 -0
- package/dist/css/text-field.css +197 -0
- package/dist/css/time-field.css +277 -0
- package/dist/css/time-picker.css +707 -0
- package/dist/css/time-range-picker.css +746 -0
- package/dist/css/timeline.css +423 -0
- package/dist/css/timer.css +123 -0
- package/dist/css/timestamp.css +34 -0
- package/dist/css/toggle-group.css +424 -0
- package/dist/css/toggle.css +146 -0
- package/dist/css/tone.css +189 -0
- package/dist/css/tool-call.css +429 -0
- package/dist/css/toolbar.css +365 -0
- package/dist/css/tooltip.css +218 -0
- package/dist/css/tour.css +439 -0
- package/dist/css/transfer.css +638 -0
- package/dist/css/tree-select.css +878 -0
- package/dist/css/tree.css +733 -0
- package/dist/css/truncate.css +108 -0
- package/dist/css/typography.css +472 -0
- package/dist/css/undefined.css +58 -0
- package/dist/css/virtualizer.css +166 -0
- package/dist/css/visually-hidden.css +20 -0
- package/dist/css/watermark.css +82 -0
- package/dist/family/action-control.css +487 -0
- package/dist/family/chart.css +480 -0
- package/dist/family/check-mark.css +94 -0
- package/dist/family/choice-card.css +97 -0
- package/dist/family/collection-item.css +764 -0
- package/dist/family/field-chrome.css +287 -0
- package/dist/family/loading-ring.css +95 -0
- package/dist/family/material.css +72 -0
- package/dist/family/menu-choice.css +56 -0
- package/dist/family/motion.css +363 -0
- package/dist/family/swatch.css +59 -0
- package/dist/family/tag-list.css +59 -0
- package/family/action-control.css +3 -12
- package/index.css +7307 -6759
- package/index.unlayered.css +7309 -6761
- package/package.json +165 -164
|
@@ -0,0 +1,612 @@
|
|
|
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
|
+
/* Select 独立皮肤同时传递引入字段视觉盒、字段内动作与浮层集合行;full bundle 递归去重。 */
|
|
7
|
+
@import '../family/field-chrome.css';
|
|
8
|
+
@import '../family/action-control.css';
|
|
9
|
+
@import '../family/collection-item.css';
|
|
10
|
+
@import '../family/loading-ring.css';
|
|
11
|
+
@import '../family/motion.css';
|
|
12
|
+
@import '../family/material.css';
|
|
13
|
+
@import '../family/tag-list.css';
|
|
14
|
+
|
|
15
|
+
@layer xihan.components {
|
|
16
|
+
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
17
|
+
.xh-scope-select {
|
|
18
|
+
--xh-select-skin: 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* 坐标由定位引擎写进 style(inset-inline-start / inset-block-start),这里只定位模式与层级 */
|
|
22
|
+
.xh-scope-select[data-part='positioner'] {
|
|
23
|
+
/* 落定那一侧的可用高度,由定位引擎经内联自定义属性写进来,内容层继承它限高;
|
|
24
|
+
引擎没算(尚未落位 / 无引擎)时不额外限高 */
|
|
25
|
+
--xh-_select-available-h: 100vh;
|
|
26
|
+
/* 落定那一侧的可用宽度,同样由定位引擎经内联自定义属性写进来,行内轴据此夹取;
|
|
27
|
+
引擎没算(尚未落位 / 无引擎 / 贴边归零)时退到视口宽 */
|
|
28
|
+
--xh-_select-available-w: 100vw;
|
|
29
|
+
/* 字段盒实测宽度,由定位引擎经内联自定义属性写进来,内容层与它等宽;
|
|
30
|
+
引擎没算(尚未落位 / 无引擎)时为 0,面板取下界 */
|
|
31
|
+
--xh-_select-anchor-w: 0px;
|
|
32
|
+
/* WC 嵌套层仍在父层 DOM 内;先截断父 positioner 的方向,再按本层 placement 开一侧。 */
|
|
33
|
+
--xh-_overlay-enter-up: 0;
|
|
34
|
+
--xh-_overlay-enter-down: 0;
|
|
35
|
+
--xh-_overlay-enter-left: 0;
|
|
36
|
+
--xh-_overlay-enter-right: 0;
|
|
37
|
+
/* 列表的自绘条浮在内容之上:轨道不上底色,实色轨道会在列表右缘糊一条竖灰带 */
|
|
38
|
+
--xh-scrollbar-track-bg: transparent;
|
|
39
|
+
|
|
40
|
+
position: fixed;
|
|
41
|
+
z-index: var(--xh-select-layer, var(--xh-_layer, var(--xh-layer-popover)));
|
|
42
|
+
/* 空壳不吃指针,交互只发生在 content 上 */
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* 锚点被滚出可视区:整个浮层随之收起 */
|
|
47
|
+
.xh-scope-select[data-part='positioner'][data-hidden] {
|
|
48
|
+
visibility: hidden;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* 进场位移按落定的一侧给。placement 与 translate 都是物理量,不随书写方向翻。 */
|
|
52
|
+
.xh-scope-select[data-part='positioner'][data-placement^='top'] {
|
|
53
|
+
--xh-_overlay-enter-down: 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.xh-scope-select[data-part='positioner'][data-placement^='bottom'] {
|
|
57
|
+
--xh-_overlay-enter-up: 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.xh-scope-select[data-part='positioner'][data-placement^='left'] {
|
|
61
|
+
--xh-_overlay-enter-right: 1;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.xh-scope-select[data-part='positioner'][data-placement^='right'] {
|
|
65
|
+
--xh-_overlay-enter-left: 1;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* 私有槽同时声明在根与 positioner 上:浮层被搬到 portal 落点,不是根的后代,继承不过去 */
|
|
69
|
+
.xh-scope-select:is([data-part='root'], [data-part='positioner']) {
|
|
70
|
+
/* 尺寸档只换这几个私有槽,触发器与条目都从这两处继承它们,
|
|
71
|
+
换档不必给每个部件各写一条选择器;形态三档由家族按 control 上的 data-variant 生成,皮肤不再声明 */
|
|
72
|
+
--xh-_select-h: var(--xh-control-h-md);
|
|
73
|
+
--xh-_select-px: var(--xh-control-px-md);
|
|
74
|
+
--xh-_select-item-py: var(--xh-list-option-py-md);
|
|
75
|
+
--xh-_select-item-px: var(--xh-control-px-md);
|
|
76
|
+
--xh-_select-gap: var(--xh-control-gap-md);
|
|
77
|
+
--xh-_select-font-size: var(--xh-control-font-md);
|
|
78
|
+
|
|
79
|
+
/* 语气只落在勾选标记上,单选与多选正文使用同一颜色。 */
|
|
80
|
+
--xh-_select-accent: var(--xh-_tone, var(--xh-fg-brand));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.xh-scope-select[data-part='root'] {
|
|
84
|
+
/* 作者塞进指示符槽的图标跟着控件的尺寸档走;它自己写了 size 时仍以作者的为准。
|
|
85
|
+
浮层条目里自绘的状态字形(勾选标记所在的标记盒与盒里的勾)不读这支:它们是指示符,走
|
|
86
|
+
--xh-control-indicator-* 一族——标记盒在自己身上把 --xh-icon-size 改接到盒的尺 */
|
|
87
|
+
--xh-icon-size: var(--xh-select-icon-size, var(--xh-glyph-size-md));
|
|
88
|
+
|
|
89
|
+
display: inline-flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
gap: var(--xh-select-gap, var(--xh-space-1));
|
|
92
|
+
/* 隐藏 select 以此为定位基准:它必须留在布局里,原生校验提示要有处可贴 */
|
|
93
|
+
position: relative;
|
|
94
|
+
|
|
95
|
+
/* 不传尺寸时一律这么宽,宽度不随内容走;父容器给不出这么宽时整件跟着收,地板同步让步,不越出父容器。
|
|
96
|
+
地板不高过缺省宽:使用者把缺省宽钉到底线以下时不必再放开底线 */
|
|
97
|
+
inline-size: var(--xh-select-control-w, var(--xh-control-w));
|
|
98
|
+
min-inline-size: min(var(--xh-select-control-w, var(--xh-control-w)), var(--xh-select-control-min-w, var(--xh-control-min-w)), 100%);
|
|
99
|
+
max-inline-size: 100%;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* —— 尺寸 —— */
|
|
103
|
+
/* 缺省档写在上面的基础规则里 */
|
|
104
|
+
.xh-scope-select:is([data-part='root'], [data-part='positioner'])[data-size='sm'] {
|
|
105
|
+
--xh-_select-h: var(--xh-control-h-sm);
|
|
106
|
+
--xh-_select-px: var(--xh-control-px-sm);
|
|
107
|
+
--xh-_select-item-py: var(--xh-list-option-py-sm);
|
|
108
|
+
--xh-_select-item-px: var(--xh-control-px-sm);
|
|
109
|
+
--xh-_select-gap: var(--xh-control-gap-sm);
|
|
110
|
+
--xh-_select-font-size: var(--xh-control-font-sm);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* 图标只跟着盒那一侧换档:浮层里的勾选标记有自己的指示符盒,换成整档图标会撑破它 */
|
|
114
|
+
.xh-scope-select[data-part='root'][data-size='sm'] {
|
|
115
|
+
--xh-icon-size: var(--xh-select-icon-size, var(--xh-glyph-size-sm));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.xh-scope-select[data-part='root'][data-size='lg'] {
|
|
119
|
+
--xh-icon-size: var(--xh-select-icon-size, var(--xh-glyph-size-lg));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.xh-scope-select:is([data-part='root'], [data-part='positioner'])[data-size='lg'] {
|
|
123
|
+
--xh-_select-h: var(--xh-control-h-lg);
|
|
124
|
+
--xh-_select-px: var(--xh-control-px-lg);
|
|
125
|
+
--xh-_select-item-py: var(--xh-list-option-py-lg);
|
|
126
|
+
--xh-_select-item-px: var(--xh-control-px-lg);
|
|
127
|
+
--xh-_select-gap: var(--xh-control-gap-lg);
|
|
128
|
+
--xh-_select-font-size: var(--xh-control-font-lg);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.xh-scope-select[data-part='label'] {
|
|
132
|
+
color: var(--xh-select-label-fg, var(--xh-fg-default));
|
|
133
|
+
font-size: var(--xh-select-label-font-size, var(--xh-text-label-size));
|
|
134
|
+
font-weight: var(--xh-select-label-font-weight, var(--xh-text-label-weight));
|
|
135
|
+
line-height: var(--xh-leading-none);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.xh-scope-select[data-part='label'][data-disabled] {
|
|
139
|
+
color: var(--xh-select-label-fg-disabled, var(--xh-fg-subtle));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* 盒:描边、底色、圆角、控件高度、行内内衬、聚焦环、五态与悬停由 Field Chrome 家族画在这一层,
|
|
143
|
+
触发器与清空按钮在里面并排;焦点落在哪颗按钮上,看到的都是同一个框亮起来(家族 :focus-within)。
|
|
144
|
+
组件只映射既有公开槽(shadow 缺省 none:字段静息描边式、无影);盒里是按钮而不是文本光标 */
|
|
145
|
+
.xh-scope-select[data-part='control'] {
|
|
146
|
+
--xh-field-control-height: var(--xh-select-control-h, var(--xh-_select-h));
|
|
147
|
+
--xh-field-control-padding-inline: var(--xh-select-control-px, var(--xh-_select-px));
|
|
148
|
+
--xh-field-control-gap: var(--xh-select-control-gap, var(--xh-_select-gap));
|
|
149
|
+
--xh-field-control-min-inline-size: var(--xh-select-control-min-w, var(--xh-control-min-w));
|
|
150
|
+
--xh-field-control-radius: var(--xh-select-control-radius, var(--xh-shape-control));
|
|
151
|
+
--xh-field-bg-rest: var(--xh-select-control-bg, var(--xh-_field-variant-bg-rest));
|
|
152
|
+
--xh-field-bg-hover: var(--xh-select-control-bg-hover, var(--xh-_field-variant-bg-hover));
|
|
153
|
+
--xh-field-bg-read-only: var(--xh-select-control-bg-readonly, var(--xh-_field-variant-bg-read-only));
|
|
154
|
+
--xh-field-bg-disabled: var(--xh-select-control-bg-disabled, var(--xh-_field-variant-bg-disabled));
|
|
155
|
+
--xh-field-fg-rest: var(--xh-select-control-fg, var(--xh-fg-default));
|
|
156
|
+
--xh-field-border-rest: var(--xh-select-control-border, var(--xh-_field-variant-border-rest));
|
|
157
|
+
--xh-field-border-hover: var(--xh-select-control-border-hover, var(--xh-_field-variant-border-hover));
|
|
158
|
+
--xh-field-border-focus: var(--xh-select-control-border-focus, var(--xh-_field-variant-border-focus));
|
|
159
|
+
--xh-field-border-invalid: var(--xh-select-control-border-invalid, var(--xh-_field-variant-border-invalid));
|
|
160
|
+
--xh-field-ring-focus: var(--xh-ring-focus);
|
|
161
|
+
--xh-field-ring-invalid: var(--xh-ring-invalid);
|
|
162
|
+
--xh-field-shadow-rest: var(--xh-select-control-shadow, none);
|
|
163
|
+
--xh-field-cursor-rest: pointer;
|
|
164
|
+
/* 家族 chrome 会重写 --xh-icon-size,使用者图标槽必须经桥接槽下发才能在盒内生效 */
|
|
165
|
+
--xh-field-glyph-size: var(--xh-select-icon-size, var(--xh-_field-size-glyph-size));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* 触发器退化成盒里那颗可聚焦的按钮:描边、底色与内衬归盒,它只占满剩余一行 */
|
|
169
|
+
.xh-scope-select[data-part='trigger'] {
|
|
170
|
+
display: inline-flex;
|
|
171
|
+
flex: 1 1 auto;
|
|
172
|
+
align-items: center;
|
|
173
|
+
justify-content: space-between;
|
|
174
|
+
gap: var(--xh-select-trigger-gap, var(--xh-_select-gap));
|
|
175
|
+
/* 弹性子项默认最小尺寸是内容尺寸,不归零则长值把盒撑破、省略号永远轮不到 */
|
|
176
|
+
min-inline-size: 0;
|
|
177
|
+
padding: 0;
|
|
178
|
+
border: 0;
|
|
179
|
+
background: transparent;
|
|
180
|
+
color: var(--xh-select-trigger-fg, var(--xh-fg-default));
|
|
181
|
+
font-size: var(--xh-select-trigger-font-size, var(--xh-_select-font-size));
|
|
182
|
+
line-height: var(--xh-leading-none);
|
|
183
|
+
text-align: start;
|
|
184
|
+
cursor: pointer;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* 清空按钮:盒里 trigger 的兄弟节点,排在触发器之后,与展开箭头一样宽;清不了时连接层给 hidden。
|
|
188
|
+
正方视觉盒、inset 圆角、悬停 100 / 按下 200 与 0.97 按压、粗指针热区与 :focus-visible 关环
|
|
189
|
+
(盒的 :focus-within 已画了一圈)全由 Action Control 的 field-inset ghost 档给,组件只映射既有覆盖槽 */
|
|
190
|
+
.xh-scope-select[data-part='clear-trigger'] {
|
|
191
|
+
--xh-action-visual-size: var(--xh-select-action-size, var(--xh-_action-profile-visual-size));
|
|
192
|
+
--xh-action-min-inline-size: var(--xh-select-action-size, var(--xh-_action-profile-visual-size));
|
|
193
|
+
--xh-action-radius: var(--xh-select-action-radius, var(--xh-shape-inset));
|
|
194
|
+
/* 底色阶梯由 ghost 档给(透明 → 100 → 200),使用者槽只作覆盖入口 */
|
|
195
|
+
--xh-action-bg-rest: var(--xh-select-action-bg, var(--xh-_action-variant-bg-rest));
|
|
196
|
+
--xh-action-bg-hover: var(--xh-select-action-bg-hover, var(--xh-_action-variant-bg-hover));
|
|
197
|
+
--xh-action-bg-pressed: var(--xh-select-action-bg-active, var(--xh-_action-variant-bg-pressed));
|
|
198
|
+
--xh-action-fg-rest: var(--xh-select-action-fg, var(--xh-fg-muted));
|
|
199
|
+
--xh-action-fg-hover: var(--xh-select-action-fg-hover, var(--xh-fg-default));
|
|
200
|
+
--xh-action-border-rest: transparent;
|
|
201
|
+
--xh-action-highlight-rest: transparent;
|
|
202
|
+
--xh-action-shadow-rest: none;
|
|
203
|
+
--xh-action-shadow-hover: none;
|
|
204
|
+
--xh-action-shadow-pressed: none;
|
|
205
|
+
/* 字号钉死:继承页面字号会让行框高过按钮,字形被基线顶离正中 */
|
|
206
|
+
--xh-action-font-size: var(--xh-select-action-font-size, var(--xh-text-secondary-size));
|
|
207
|
+
/* 配方尚未把 profile 字形档灌进 --xh-icon-size,钮内字形先按 field-inset 档逐钮取值 */
|
|
208
|
+
--xh-icon-size: var(--xh-_action-profile-glyph-size);
|
|
209
|
+
|
|
210
|
+
border-width: 0;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* 没值时连接层给的是 hidden 属性;家族那条 display 会把 UA 规则盖掉 */
|
|
214
|
+
.xh-scope-select[data-part='clear-trigger'][hidden] {
|
|
215
|
+
display: none;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/* 标签行:触发器里收着可见标签与 +N 那一枚的一行,行里每一枚都是 tag(data-scope="tag"),样子归 tag.css;
|
|
219
|
+
行怎么排、标签怎么进出归标签行家族配方(family/tag-list.css),这里只把使用者的间距槽接进去。
|
|
220
|
+
展开箭头靠触发器的 space-between 留在末端,行本身不必撑开 */
|
|
221
|
+
.xh-scope-select[data-part='tag-list'] {
|
|
222
|
+
--xh-tag-list-gap: var(--xh-select-tag-list-gap, var(--xh-space-1));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* 标签行露面时 value-text 让位:两者是触发器里的同一格,占位文字与标签不同屏。
|
|
226
|
+
value-text 留在 DOM 里,trigger 的可及名仍从它取到完整的选中项文本 */
|
|
227
|
+
.xh-scope-select[data-part='trigger']:has([data-part='tag-list']:not([hidden])) [data-part='value-text']:where(.xh-scope-select) {
|
|
228
|
+
display: none;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* 环画在盒上,按钮自己不再画:两圈套着的环读起来像两个控件 */
|
|
232
|
+
.xh-scope-select[data-part='trigger']:focus-visible {
|
|
233
|
+
outline: none;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* trigger 是单体控件,用原生 disabled(条目那边一律 aria-disabled) */
|
|
237
|
+
.xh-scope-select[data-part='trigger']:disabled {
|
|
238
|
+
color: var(--xh-fg-disabled);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/* 盒宽由 control 定,这里得允许自己被压缩:弹性子项默认最小尺寸是内容尺寸,
|
|
242
|
+
不归零则长值把行撑破、省略号永远轮不到 */
|
|
243
|
+
.xh-scope-select[data-part='value-text'] {
|
|
244
|
+
flex: 1;
|
|
245
|
+
min-inline-size: 0;
|
|
246
|
+
overflow: hidden;
|
|
247
|
+
white-space: nowrap;
|
|
248
|
+
text-overflow: ellipsis;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/* 无选中:显示的是 placeholder,画淡一档 */
|
|
252
|
+
.xh-scope-select[data-part='value-text'][data-placeholder] {
|
|
253
|
+
color: var(--xh-select-placeholder-fg, var(--xh-fg-subtle));
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/* 有值时清空钮顶上来,箭头让位:两个图标并排堆着,用户分不清点哪个。
|
|
257
|
+
判据查的是盒里此刻真有一颗没收起的清空钮,不是「有没有值」——
|
|
258
|
+
作者没摆清空钮时箭头照常留着,不然让了位没人接,指示符整个消失 */
|
|
259
|
+
.xh-scope-select[data-part='control']:has([data-part='clear-trigger']:not([hidden])) [data-part='indicator']:where(.xh-scope-select) {
|
|
260
|
+
display: none;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* 展开箭头与清空钮同一把尺:两者互斥显示,换来换去不该让盒里的宽度跳一下 */
|
|
264
|
+
.xh-scope-select[data-part='indicator'] {
|
|
265
|
+
display: inline-flex;
|
|
266
|
+
flex: none;
|
|
267
|
+
align-items: center;
|
|
268
|
+
justify-content: center;
|
|
269
|
+
inline-size: var(--xh-select-action-size, var(--xh-control-action-size));
|
|
270
|
+
block-size: var(--xh-select-action-size, var(--xh-control-action-size));
|
|
271
|
+
color: var(--xh-select-indicator-fg, var(--xh-fg-muted));
|
|
272
|
+
transition: rotate var(--xh-motion-duration-nudge) var(--xh-motion-ease-enter-strong);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/* 没写内容就由皮肤画箭头;作者往部件里塞了自己的图形,这条规则即不命中 */
|
|
276
|
+
.xh-scope-select[data-part='indicator']:empty::before {
|
|
277
|
+
content: '';
|
|
278
|
+
display: inline-block;
|
|
279
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
280
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
281
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
282
|
+
background-color: currentColor;
|
|
283
|
+
-webkit-mask: var(--xh-glyph-mark-chevron-down) center / contain no-repeat;
|
|
284
|
+
mask: var(--xh-glyph-mark-chevron-down) center / contain no-repeat;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.xh-scope-select[data-part='indicator'][data-state='open'] {
|
|
288
|
+
rotate: 180deg;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* 浮层外壳:描边、底色、阴影与整体尺寸归它。它自己不滚——滚的是里面的 list,
|
|
292
|
+
底部操作区因此留在视口里,不随条目滚走 */
|
|
293
|
+
.xh-scope-select[data-part='content'] {
|
|
294
|
+
/* 材质由家族配方画(family/material.css 的 frosted 面:描边、底、1px 顶光、前景、投影与背景滤镜),
|
|
295
|
+
这里只把使用者槽接进来 */
|
|
296
|
+
--xh-frosted-bg: var(--xh-select-content-bg, var(--xh-_material-bg));
|
|
297
|
+
--xh-frosted-border: var(--xh-select-content-border, var(--xh-_material-border));
|
|
298
|
+
--xh-frosted-fg: var(--xh-select-content-fg, var(--xh-_material-fg));
|
|
299
|
+
--xh-frosted-shadow: var(--xh-select-content-shadow, var(--xh-_material-shadow));
|
|
300
|
+
--xh-frosted-backdrop: var(--xh-select-content-backdrop, var(--xh-_material-backdrop));
|
|
301
|
+
--xh-frosted-highlight: var(--xh-select-content-highlight, var(--xh-_material-highlight));
|
|
302
|
+
|
|
303
|
+
position: relative;
|
|
304
|
+
display: flex;
|
|
305
|
+
flex-direction: column;
|
|
306
|
+
/* 列表型浮层与字段盒等宽:长选项在条目里截断,面板不随最长的一条变宽。锚点比下界还窄时取下界,
|
|
307
|
+
比可用区还宽时收成可用宽度;要封顶由作者另写上界槽 */
|
|
308
|
+
inline-size: min(
|
|
309
|
+
max(var(--xh-select-content-min-w, var(--xh-overlay-menu-min-w)), var(--xh-_select-anchor-w)),
|
|
310
|
+
var(--xh-_select-available-w)
|
|
311
|
+
);
|
|
312
|
+
max-inline-size: var(--xh-select-content-max-w, none);
|
|
313
|
+
max-block-size: min(var(--xh-select-content-max-h, var(--xh-overlay-menu-max-h)), var(--xh-_select-available-h));
|
|
314
|
+
padding-block: var(--xh-select-content-py, var(--xh-space-1));
|
|
315
|
+
padding-inline: var(--xh-select-content-px, var(--xh-space-1));
|
|
316
|
+
border-radius: var(--xh-select-content-radius, var(--xh-shape-overlay));
|
|
317
|
+
/* 条目的悬停底色是方角,滚到两端时会探出外壳的圆角 */
|
|
318
|
+
overflow: hidden;
|
|
319
|
+
pointer-events: auto;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* 列表框本体:只管滚动,留白归外壳。
|
|
323
|
+
min-block-size: 0 是 flex 子项能真正滚动的前提——不给的话它按内容撑高,
|
|
324
|
+
外壳的 max-block-size 就只会把溢出的部分裁掉而不是交给它滚 */
|
|
325
|
+
.xh-scope-select[data-part='list'] {
|
|
326
|
+
display: flex;
|
|
327
|
+
flex: 1 1 auto;
|
|
328
|
+
flex-direction: column;
|
|
329
|
+
gap: var(--xh-select-list-gap, var(--xh-list-option-gap));
|
|
330
|
+
min-block-size: 0;
|
|
331
|
+
overflow-y: auto;
|
|
332
|
+
/* 浮层滚动面:滚到头不把页面一起带走 */
|
|
333
|
+
overscroll-behavior: contain;
|
|
334
|
+
transition: opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/* 刷新:已有候选时后台在取,保留上一帧,列表按 micro 淡下,数据到了再淡回;在途占位此时让位 */
|
|
338
|
+
.xh-scope-select[data-part='list'][aria-busy='true'] {
|
|
339
|
+
opacity: var(--xh-state-disabled-opacity);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/* 底部操作区:贴在列表下沿,用一道分隔线与条目断开。
|
|
343
|
+
作者往里放什么由作者定,这里只管位置、留白与那条线 */
|
|
344
|
+
.xh-scope-select[data-part='footer'] {
|
|
345
|
+
display: flex;
|
|
346
|
+
flex: none;
|
|
347
|
+
align-items: center;
|
|
348
|
+
gap: var(--xh-select-footer-gap, var(--xh-space-2));
|
|
349
|
+
padding-block: var(--xh-select-footer-py, var(--xh-space-2));
|
|
350
|
+
padding-inline: var(--xh-select-footer-px, var(--xh-space-2));
|
|
351
|
+
border-block-start: var(--xh-stroke-thin) solid var(--xh-select-footer-border, var(--xh-material-frosted-separator));
|
|
352
|
+
color: var(--xh-select-footer-fg, var(--xh-material-frosted-fg-muted));
|
|
353
|
+
font-size: var(--xh-select-footer-font-size, var(--xh-text-secondary-size));
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/* 上面给了 display,UA 的 [hidden]{display:none} 已被盖掉,这里补回来 */
|
|
357
|
+
.xh-scope-select[data-part='footer'][hidden] {
|
|
358
|
+
display: none;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/* 这里刻意没有 [data-part='content'][hidden] { display: none },与 dialog 一致:
|
|
362
|
+
收起态连接层会给 content 打 hidden,而上面那条 display 正是要盖掉 UA 的
|
|
363
|
+
[hidden]{display:none}——退场动画得先能播。presence 读的是 content 的 animationName,
|
|
364
|
+
真正的收起由宿主在退场结束后落成内联 display:none(Vue 那边直接不渲染)。
|
|
365
|
+
其余声明了 display 的角色节点仍补 [hidden],那几处没有退场动画。 */
|
|
366
|
+
|
|
367
|
+
.xh-scope-select[data-part='list']:not([tabindex='0']):focus-visible {
|
|
368
|
+
outline: none;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/* 挂载时就开着的那一段(data-instant)属于首帧,直接呈现 */
|
|
372
|
+
.xh-scope-select[data-part='content'][data-state='open']:not([data-instant]) {
|
|
373
|
+
animation: xh-overlay-slide-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/* 退场:收起那一帧 hidden 由退场闸门押后,这里才播得出来。forwards 把末态钉住,
|
|
377
|
+
免得动画结束到真收起之间闪一下原样 */
|
|
378
|
+
.xh-scope-select[data-part='content'][data-state='closed'] {
|
|
379
|
+
animation: xh-overlay-slide-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
380
|
+
will-change: opacity, translate;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/* 空态占位:待在 content 里、list 的兄弟;盒与阴影归 content,这里只画一句居中的次要文字 */
|
|
384
|
+
.xh-scope-select[data-part='empty'] {
|
|
385
|
+
display: block;
|
|
386
|
+
flex: none;
|
|
387
|
+
padding-block: var(--xh-select-empty-py, var(--xh-space-3));
|
|
388
|
+
padding-inline: var(--xh-select-empty-px, var(--xh-_select-item-px));
|
|
389
|
+
color: var(--xh-select-empty-fg, var(--xh-material-frosted-fg-muted));
|
|
390
|
+
font-size: var(--xh-select-empty-font-size, var(--xh-_select-font-size));
|
|
391
|
+
line-height: var(--xh-leading-none);
|
|
392
|
+
text-align: center;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/* 上面给了 display,UA 的 [hidden]{display:none} 已被盖掉,这里补回来 */
|
|
396
|
+
.xh-scope-select[data-part='empty'][hidden] {
|
|
397
|
+
display: none;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* 在途占位:与空态占位同一个位置、同一副观感,两者不同屏 */
|
|
401
|
+
.xh-scope-select[data-part='loading'] {
|
|
402
|
+
display: flex;
|
|
403
|
+
align-items: center;
|
|
404
|
+
justify-content: center;
|
|
405
|
+
gap: var(--xh-_select-gap);
|
|
406
|
+
flex: none;
|
|
407
|
+
padding-block: var(--xh-select-loading-py, var(--xh-space-3));
|
|
408
|
+
padding-inline: var(--xh-select-loading-px, var(--xh-_select-item-px));
|
|
409
|
+
color: var(--xh-select-loading-fg, var(--xh-material-frosted-fg-muted));
|
|
410
|
+
font-size: var(--xh-select-loading-font-size, var(--xh-_select-font-size));
|
|
411
|
+
line-height: var(--xh-leading-none);
|
|
412
|
+
text-align: center;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.xh-scope-select[data-part='loading'][hidden] {
|
|
416
|
+
display: none;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/* 首次加载:文案前一枚加载环,由加载环配方画(连接层投影 data-xh-loading-ring 与 data-loading),
|
|
420
|
+
直径取所在尺寸档的图标档 */
|
|
421
|
+
.xh-scope-select[data-part='loading']::before {
|
|
422
|
+
content: '';
|
|
423
|
+
flex: none;
|
|
424
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
425
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.xh-scope-select[data-part='group'] {
|
|
429
|
+
display: flex;
|
|
430
|
+
flex-direction: column;
|
|
431
|
+
gap: var(--xh-select-group-gap, var(--xh-list-option-gap));
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.xh-scope-select[data-part='group'][hidden] {
|
|
435
|
+
display: none;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/* 后继分组用一条实体细线分段;既有 spacing 槽改管线后的内距,总节奏不另造一套。 */
|
|
439
|
+
.xh-scope-select[data-part='group'] + .xh-scope-select[data-part='group'] {
|
|
440
|
+
padding-block-start: var(--xh-select-group-spacing, var(--xh-space-1_5));
|
|
441
|
+
border-block-start: var(--xh-stroke-thin) solid
|
|
442
|
+
var(--xh-select-group-separator-color, var(--xh-material-frosted-separator));
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/* 分组标题不是选项、进不了导航,画成小号次要文字,
|
|
446
|
+
内缩与条目对齐(同一个 padding-inline),标题与条目文字才在一条竖线上 */
|
|
447
|
+
.xh-scope-select[data-part='group-label'] {
|
|
448
|
+
display: block;
|
|
449
|
+
padding-block: var(--xh-select-group-label-py, var(--xh-space-1));
|
|
450
|
+
padding-inline: var(--xh-select-group-label-px, var(--xh-_select-item-px));
|
|
451
|
+
color: var(--xh-select-group-label-fg, var(--xh-material-frosted-fg-muted));
|
|
452
|
+
font-size: var(--xh-select-group-label-font-size, var(--xh-text-caption-size));
|
|
453
|
+
font-weight: var(--xh-select-group-label-font-weight, var(--xh-font-weight-medium));
|
|
454
|
+
line-height: var(--xh-leading-none);
|
|
455
|
+
user-select: none;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.xh-scope-select[data-part='group-label'][hidden] {
|
|
459
|
+
display: none;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.xh-scope-select[data-part='item'] {
|
|
463
|
+
/* 公开 Select 槽只映射到家族合同;网格、尺寸与状态选择器不在组件皮肤复制。pressed 面与 selected 各态由家族按 overlay 上下文给出。 */
|
|
464
|
+
--xh-collection-block-padding: var(--xh-select-item-py, var(--xh-_select-item-py));
|
|
465
|
+
--xh-collection-inline-padding: var(--xh-select-item-px, var(--xh-_select-item-px));
|
|
466
|
+
--xh-collection-gap: var(--xh-select-item-gap, var(--xh-_select-gap));
|
|
467
|
+
--xh-collection-font-size: var(--xh-select-item-font-size, var(--xh-_select-font-size));
|
|
468
|
+
--xh-collection-radius: var(--xh-select-item-radius, var(--xh-shape-inset));
|
|
469
|
+
--xh-collection-fg-rest: var(--xh-select-item-fg, var(--xh-material-frosted-fg));
|
|
470
|
+
--xh-collection-fg-hover: var(--xh-select-item-fg, var(--xh-material-frosted-fg));
|
|
471
|
+
--xh-collection-fg-keyboard-highlight: var(--xh-select-item-fg, var(--xh-material-frosted-fg));
|
|
472
|
+
--xh-collection-fg-selected: var(--xh-select-item-fg-selected, var(--xh-select-item-fg, var(--xh-material-frosted-fg)));
|
|
473
|
+
--xh-collection-fg-selected-highlight: var(--xh-select-item-fg-selected, var(--xh-select-item-fg, var(--xh-material-frosted-fg)));
|
|
474
|
+
--xh-collection-fg-selected-hover: var(--xh-select-item-fg-selected, var(--xh-select-item-fg, var(--xh-material-frosted-fg)));
|
|
475
|
+
--xh-collection-fg-selected-pressed: var(--xh-select-item-fg-selected, var(--xh-select-item-fg, var(--xh-material-frosted-fg)));
|
|
476
|
+
--xh-collection-fg-pressed: var(--xh-select-item-fg, var(--xh-material-frosted-fg));
|
|
477
|
+
--xh-collection-font-weight-selected: var(--xh-select-item-font-weight-selected, var(--xh-font-weight-regular));
|
|
478
|
+
--xh-collection-font-weight-selected-highlight: var(--xh-select-item-font-weight-selected, var(--xh-font-weight-regular));
|
|
479
|
+
--xh-collection-font-weight-selected-hover: var(--xh-select-item-font-weight-selected, var(--xh-font-weight-regular));
|
|
480
|
+
--xh-collection-font-weight-selected-pressed: var(--xh-select-item-font-weight-selected, var(--xh-font-weight-regular));
|
|
481
|
+
--xh-collection-bg-hover: var(--xh-select-item-bg-hover, var(--xh-bg-subtle));
|
|
482
|
+
--xh-collection-bg-keyboard-highlight: var(--xh-select-item-bg-hover, var(--xh-bg-subtle));
|
|
483
|
+
--xh-collection-bg-selected-highlight: var(--xh-select-item-bg-hover, var(--xh-bg-subtle));
|
|
484
|
+
--xh-collection-bg-selected-hover: var(--xh-select-item-bg-hover, var(--xh-bg-subtle));
|
|
485
|
+
--xh-collection-bg-pressed: var(--xh-select-item-bg-pressed, var(--xh-bg-subtle-hover));
|
|
486
|
+
--xh-collection-bg-selected-pressed: var(--xh-select-item-bg-pressed, var(--xh-bg-subtle-hover));
|
|
487
|
+
/* data-highlighted 同时覆盖指针与键盘路径;指针只换面,焦点环在 :focus-visible 下再接回。 */
|
|
488
|
+
--xh-collection-outline-keyboard-highlight: transparent;
|
|
489
|
+
--xh-collection-outline-selected-highlight: transparent;
|
|
490
|
+
--xh-collection-indicator-fg-rest: var(--xh-select-item-check-fg, var(--xh-_select-accent));
|
|
491
|
+
--xh-collection-indicator-fg-checked: var(--xh-select-item-check-fg, var(--xh-_select-accent));
|
|
492
|
+
--xh-collection-indicator-fg-selected: var(--xh-select-item-check-fg, var(--xh-_select-accent));
|
|
493
|
+
--xh-collection-indicator-fg-selected-hover: var(--xh-select-item-check-fg, var(--xh-_select-accent));
|
|
494
|
+
--xh-collection-indicator-fg-selected-highlight: var(--xh-select-item-check-fg, var(--xh-_select-accent));
|
|
495
|
+
--xh-collection-indicator-fg-selected-pressed: var(--xh-select-item-check-fg, var(--xh-_select-accent));
|
|
496
|
+
|
|
497
|
+
/* 行高留出文字的上下伸展空间,行内那层 overflow:hidden 才不会把字削掉 */
|
|
498
|
+
line-height: var(--xh-select-item-leading, var(--xh-leading-normal));
|
|
499
|
+
white-space: nowrap;
|
|
500
|
+
user-select: none;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/* 键盘焦点出现时底色立即到位,环不会压在背景过渡的中间帧上。 */
|
|
504
|
+
.xh-scope-select[data-part='item']:focus-visible:not(:hover) {
|
|
505
|
+
--xh-collection-outline-keyboard-highlight: var(--xh-ring-focus);
|
|
506
|
+
--xh-collection-outline-selected-highlight: var(--xh-ring-focus);
|
|
507
|
+
|
|
508
|
+
transition: none;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.xh-scope-select[data-part='item-text'] {
|
|
512
|
+
/* 弹性子项默认最小尺寸是内容尺寸,不归零则长文本把行撑破、省略号轮不上 */
|
|
513
|
+
min-inline-size: 0;
|
|
514
|
+
overflow: hidden;
|
|
515
|
+
white-space: nowrap;
|
|
516
|
+
text-overflow: ellipsis;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/* 勾选标记只在选中项上出现;未选中时占位不塌,切换选中不引起行宽抖动。
|
|
520
|
+
盒与盒里的勾是指示符:盒按指示符档取尺,并在自己身上把 --xh-icon-size 改接到盒的尺,皮肤画的
|
|
521
|
+
兜底勾与作者塞进盒里的 XhIcon 读同一把尺、与盒同边长(勾选标记不是勾选格,不取 × 0.75,与 Listbox / Menu 族
|
|
522
|
+
同口径);不读家族按档下发到行的 --xh-icon-size——那支只管作者放进条目里的图标,按图标档取的 20px 比
|
|
523
|
+
16 / 14 的指示符档大一圈 */
|
|
524
|
+
.xh-scope-select[data-part='item-indicator'] {
|
|
525
|
+
--xh-icon-size: var(--xh-select-item-indicator-size, var(--xh-control-indicator-size));
|
|
526
|
+
|
|
527
|
+
display: inline-flex;
|
|
528
|
+
align-items: center;
|
|
529
|
+
justify-content: center;
|
|
530
|
+
inline-size: var(--xh-select-item-indicator-size, var(--xh-control-indicator-size));
|
|
531
|
+
block-size: var(--xh-select-item-indicator-size, var(--xh-control-indicator-size));
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/* 同上:没写内容就由皮肤画勾。尺寸读标记盒自己改接过的 --xh-icon-size:与盒同边长,随指示符档换档 */
|
|
535
|
+
.xh-scope-select[data-part='item-indicator']:empty::before {
|
|
536
|
+
content: '';
|
|
537
|
+
display: inline-block;
|
|
538
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
539
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
540
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
541
|
+
background-color: currentColor;
|
|
542
|
+
-webkit-mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
543
|
+
mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/* 表单影子:视觉隐藏但留在布局与表单里,原生校验提示需要一个可定位的框 */
|
|
547
|
+
.xh-scope-select[data-part='hidden-select'] {
|
|
548
|
+
pointer-events: none;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/* 没写内容就由皮肤画兜底字形;作者往部件里塞了自己的图形,这几条即不命中 */
|
|
552
|
+
.xh-scope-select[data-part='clear-trigger']:empty::before {
|
|
553
|
+
content: '';
|
|
554
|
+
display: inline-block;
|
|
555
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
556
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
557
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
558
|
+
background-color: currentColor;
|
|
559
|
+
-webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
560
|
+
mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
|
|
564
|
+
写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
|
|
565
|
+
.xh-scope-select[data-part='root'][hidden],
|
|
566
|
+
.xh-scope-select[data-part='control'][hidden],
|
|
567
|
+
.xh-scope-select[data-part='trigger'][hidden],
|
|
568
|
+
.xh-scope-select[data-part='indicator'][hidden],
|
|
569
|
+
.xh-scope-select[data-part='list'][hidden],
|
|
570
|
+
.xh-scope-select[data-part='item'][hidden],
|
|
571
|
+
.xh-scope-select[data-part='item-indicator'][hidden] {
|
|
572
|
+
display: none;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
@media print {
|
|
576
|
+
/* 打印:定位层与遮罩是交互期才存在的东西,落到纸上只会盖住底下的正文。
|
|
577
|
+
收起写在这份皮肤里而不是 reset:reset 层排在组件层之前,组件层里任何一条 display 都压得住它。 */
|
|
578
|
+
.xh-scope-select[data-part='positioner'] {
|
|
579
|
+
display: none;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
@media (forced-colors: active) {
|
|
584
|
+
/* 兜底字形是 mask 挖出来的一块底色,这一档里底色被系统换成 Canvas,字形跟着消失。
|
|
585
|
+
字形退出强制换色、直接写系统色(不能取 currentColor:退出强制换色的伪元素读到的是被系统换掉之前的作者色):
|
|
586
|
+
按钮面上取 ButtonText,悬停与按下时家族把按钮涂成 Highlight、字形换 HighlightText;
|
|
587
|
+
条目面上取 CanvasText;按下与没被高亮时的悬停,家族把条目涂成 Highlight,字形换 HighlightText;
|
|
588
|
+
字段面上取 CanvasText;
|
|
589
|
+
禁用取 GrayText */
|
|
590
|
+
.xh-scope-select[data-part='indicator']:empty::before,
|
|
591
|
+
.xh-scope-select[data-part='item-indicator']:empty::before {
|
|
592
|
+
forced-color-adjust: none;
|
|
593
|
+
background-color: CanvasText;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
.xh-scope-select[data-part='clear-trigger']:empty::before {
|
|
597
|
+
forced-color-adjust: none;
|
|
598
|
+
background-color: ButtonText;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.xh-scope-select[data-part='item']:not([aria-disabled='true'], [data-disabled], [aria-busy='true'], [data-error]):is(:active, [data-pressed], :hover:not(:focus-visible, [data-highlighted])) .xh-scope-select[data-part='item-indicator']:empty::before,
|
|
602
|
+
.xh-scope-select[data-part='clear-trigger']:not([data-disabled]):not([data-loading]):is(:hover, :active, [data-pressed]):empty::before {
|
|
603
|
+
background-color: HighlightText;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
.xh-scope-select[data-part='control'][data-disabled] .xh-scope-select[data-part='indicator']:empty::before,
|
|
607
|
+
.xh-scope-select[data-part='item']:is([aria-disabled='true'], [data-disabled]) .xh-scope-select[data-part='item-indicator']:empty::before,
|
|
608
|
+
.xh-scope-select[data-part='clear-trigger'][data-disabled]:empty::before {
|
|
609
|
+
background-color: GrayText;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}
|