@xihan-ui/styles 2.0.0 → 3.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 +1328 -0
- package/README.md +6 -1
- package/component-tokens.d.ts +505 -111
- package/components.tokens.json +34750 -26291
- package/css/accordion.css +39 -13
- package/css/alert.css +61 -3
- package/css/anchor.css +49 -11
- package/css/approval.css +124 -84
- package/css/avatar-group.css +1 -1
- package/css/avatar.css +13 -5
- package/css/back-top.css +63 -44
- package/css/badge.css +63 -13
- package/css/bar-code.css +1 -1
- package/css/breadcrumb.css +63 -4
- package/css/button-group.css +5 -5
- package/css/button.css +69 -21
- package/css/calendar-picker.css +27 -8
- package/css/calendar-range-picker.css +48 -11
- package/css/card.css +116 -2
- package/css/carousel.css +153 -48
- package/css/cartesian-chart.css +830 -0
- package/css/cascader.css +184 -70
- package/css/checkbox-group.css +69 -99
- package/css/checkbox.css +21 -54
- package/css/citation.css +470 -0
- package/css/clipboard.css +23 -66
- package/css/code-view.css +103 -8
- package/css/collapsible.css +37 -11
- package/css/color-field.css +18 -0
- package/css/color-picker.css +57 -62
- package/css/color-slider.css +26 -19
- package/css/color-swatch-picker.css +8 -6
- package/css/combobox.css +82 -37
- package/css/command.css +48 -48
- package/css/context-menu.css +43 -28
- package/css/date-field.css +23 -0
- package/css/date-picker.css +57 -24
- package/css/date-range-picker.css +301 -14
- package/css/description.css +17 -1
- package/css/descriptions.css +43 -1
- package/css/dialog.css +99 -43
- package/css/diff-view.css +101 -16
- package/css/download-trigger.css +46 -80
- package/css/drawer.css +168 -133
- package/css/editable.css +19 -0
- package/css/empty-state.css +8 -7
- package/css/field-array.css +36 -0
- package/css/field.css +17 -19
- package/css/fieldset.css +1 -1
- package/css/file-upload.css +126 -136
- package/css/flex.css +324 -8
- package/css/float-button.css +168 -41
- package/css/floating-panel.css +59 -27
- package/css/form.css +26 -20
- package/css/funnel-chart.css +106 -0
- package/css/graph-chart.css +205 -0
- package/css/grid-list.css +235 -0
- package/css/grid.css +252 -1
- package/css/heatmap.css +119 -36
- package/css/hierarchy-chart.css +298 -0
- package/css/hover-card.css +33 -18
- package/css/icon.css +100 -0
- package/css/image-cropper.css +34 -8
- package/css/image-viewer.css +169 -26
- package/css/image.css +23 -4
- package/css/infinite-scroll.css +2 -2
- package/css/input-group.css +13 -15
- package/css/json-viewer.css +55 -7
- package/css/kbd.css +1 -1
- package/css/layout.css +71 -21
- package/css/liquid.css +106 -0
- package/css/list.css +2 -2
- package/css/listbox.css +72 -23
- package/css/loading-bar.css +27 -13
- package/css/log.css +131 -35
- package/css/markdown-stream.css +1 -1
- package/css/marquee.css +163 -7
- package/css/matrix-code.css +1 -1
- package/css/mention.css +35 -21
- package/css/menu.css +40 -28
- package/css/menubar.css +42 -28
- package/css/message-feed.css +174 -53
- package/css/navigation-menu.css +177 -18
- package/css/notification.css +431 -110
- package/css/number-field.css +22 -0
- package/css/page-header.css +4 -2
- package/css/pagination.css +129 -29
- package/css/password-input.css +40 -8
- package/css/pie-chart.css +247 -0
- package/css/popconfirm.css +50 -58
- package/css/popover.css +55 -21
- package/css/progress.css +308 -10
- package/css/prompt-input.css +37 -1
- package/css/question-flow.css +104 -64
- package/css/radar-chart.css +233 -0
- package/css/radio-group.css +372 -14
- package/css/rating.css +25 -27
- package/css/reasoning.css +62 -55
- package/css/reset.css +1 -1
- package/css/resizable.css +6 -1
- package/css/sankey-chart.css +174 -0
- package/css/scroll-area.css +32 -0
- package/css/scrollbar.css +1 -1
- package/css/select.css +76 -59
- package/css/side-nav.css +177 -30
- package/css/signature-pad.css +23 -8
- package/css/skeleton.css +13 -14
- package/css/slider.css +39 -17
- package/css/sortable.css +38 -8
- package/css/sparkline.css +164 -0
- package/css/spinner.css +50 -22
- package/css/splitter.css +8 -2
- package/css/statistic.css +10 -0
- package/css/steps.css +257 -38
- package/css/switch.css +30 -55
- package/css/table.css +168 -128
- package/css/tabs.css +243 -31
- package/css/tag-group.css +65 -37
- package/css/tag.css +55 -14
- package/css/tags-input.css +40 -3
- package/css/text-field.css +19 -0
- package/css/time-field.css +20 -1
- package/css/time-picker.css +44 -17
- package/css/time-range-picker.css +45 -18
- package/css/timeline.css +1 -1
- package/css/toggle-group.css +8 -8
- package/css/toggle.css +6 -5
- package/css/tool-call.css +64 -56
- package/css/toolbar.css +105 -7
- package/css/tooltip.css +18 -7
- package/css/tour.css +49 -21
- package/css/transfer.css +104 -81
- package/css/tree-select.css +235 -58
- package/css/tree.css +240 -147
- package/css/truncate.css +55 -12
- package/css/typography.css +93 -0
- package/css/virtualizer.css +57 -1
- package/css/watermark.css +23 -0
- package/family/action-control.css +14 -5
- package/family/chart.css +480 -0
- package/family/check-mark.css +94 -0
- package/family/choice-card.css +97 -0
- package/family/collection-item.css +70 -27
- package/family/field-chrome.css +1 -12
- package/family/loading-ring.css +95 -0
- package/family/material.css +72 -0
- package/family/menu-choice.css +56 -0
- package/family/motion.css +208 -11
- package/family/tag-list.css +59 -0
- package/index.css +23363 -14091
- package/index.unlayered.css +23198 -13922
- package/package.json +20 -8
- package/css/gradient-text.css +0 -91
- package/css/icon-wrapper.css +0 -81
- package/css/segmented.css +0 -280
- package/css/toast.css +0 -499
package/css/tree.css
CHANGED
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
/* 定义 tree 样式。 */
|
|
7
7
|
|
|
8
|
+
/* 共享关键帧由 family/motion.css 提供,本皮肤 @import 它,单独引入仍成立。 */
|
|
9
|
+
@import '../family/motion.css';
|
|
8
10
|
@import '../family/collection-item.css';
|
|
11
|
+
@import '../family/loading-ring.css';
|
|
9
12
|
|
|
10
13
|
@layer xihan.components {
|
|
11
14
|
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
@@ -14,10 +17,17 @@
|
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
[data-scope='tree'][data-part='root'] {
|
|
17
|
-
/*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
/* 尺寸档只换这几支私有槽,行、指示符盒、缩进与占位从 root 继承,走集合家族的尺寸档:
|
|
21
|
+
行的块向内衬取列表条目档、行内内衬 / 间距 / 字号取控件档、指示符盒取指示符档、缩进一档一格 */
|
|
22
|
+
--xh-_tree-row-py: var(--xh-list-option-py-md);
|
|
23
|
+
--xh-_tree-row-px: var(--xh-control-px-md);
|
|
24
|
+
--xh-_tree-row-gap: var(--xh-control-gap-md);
|
|
25
|
+
--xh-_tree-font-size: var(--xh-control-font-md);
|
|
26
|
+
--xh-_tree-indicator: var(--xh-control-indicator-md);
|
|
27
|
+
--xh-_tree-indent: var(--xh-space-4);
|
|
28
|
+
/* 行外的字形(空态 / 在途占位里的加载环与作者塞的图标)按档取尺;行内的由家族随 data-xh-collection-size
|
|
29
|
+
下发。这支只管作者放进行里的图标:树自绘的状态字形(展开方向、行尾对号与半选杠)是指示符,
|
|
30
|
+
各部件在自己身上把 --xh-icon-size 改接到指示符盒的尺 */
|
|
21
31
|
--xh-icon-size: var(--xh-tree-icon-size, var(--xh-glyph-size-md));
|
|
22
32
|
|
|
23
33
|
display: flex;
|
|
@@ -25,6 +35,26 @@
|
|
|
25
35
|
gap: var(--xh-tree-gap, var(--xh-space-2));
|
|
26
36
|
}
|
|
27
37
|
|
|
38
|
+
[data-scope='tree'][data-part='root'][data-size='sm'] {
|
|
39
|
+
--xh-_tree-row-py: var(--xh-list-option-py-sm);
|
|
40
|
+
--xh-_tree-row-px: var(--xh-control-px-sm);
|
|
41
|
+
--xh-_tree-row-gap: var(--xh-control-gap-sm);
|
|
42
|
+
--xh-_tree-font-size: var(--xh-control-font-sm);
|
|
43
|
+
--xh-_tree-indicator: var(--xh-control-indicator-sm);
|
|
44
|
+
--xh-_tree-indent: var(--xh-space-3);
|
|
45
|
+
--xh-icon-size: var(--xh-tree-icon-size, var(--xh-glyph-size-sm));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[data-scope='tree'][data-part='root'][data-size='lg'] {
|
|
49
|
+
--xh-_tree-row-py: var(--xh-list-option-py-lg);
|
|
50
|
+
--xh-_tree-row-px: var(--xh-control-px-lg);
|
|
51
|
+
--xh-_tree-row-gap: var(--xh-control-gap-lg);
|
|
52
|
+
--xh-_tree-font-size: var(--xh-control-font-lg);
|
|
53
|
+
--xh-_tree-indicator: var(--xh-control-indicator-lg);
|
|
54
|
+
--xh-_tree-indent: var(--xh-space-5);
|
|
55
|
+
--xh-icon-size: var(--xh-tree-icon-size, var(--xh-glyph-size-lg));
|
|
56
|
+
}
|
|
57
|
+
|
|
28
58
|
[data-scope='tree'][data-part='root'][hidden] {
|
|
29
59
|
display: none;
|
|
30
60
|
}
|
|
@@ -77,14 +107,16 @@
|
|
|
77
107
|
}
|
|
78
108
|
|
|
79
109
|
/* 空态占位:待在 root 里、tree 的兄弟(role=tree 只许拥有 treeitem 与 group)。
|
|
80
|
-
|
|
110
|
+
与在途占位同一副排版:一行居中的次要文字,字号与行内内衬随尺寸档与条目同档,块向内距一档 */
|
|
81
111
|
[data-scope='tree'][data-part='empty'] {
|
|
82
|
-
display:
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: center;
|
|
83
115
|
padding-block: var(--xh-tree-empty-py, var(--xh-space-3));
|
|
84
|
-
padding-inline: var(--xh-tree-empty-px, var(--xh-
|
|
85
|
-
color: var(--xh-tree-empty-fg, var(--xh-fg-
|
|
86
|
-
font-size: var(--xh-tree-empty-font-size, var(--xh-
|
|
87
|
-
line-height: var(--xh-leading-
|
|
116
|
+
padding-inline: var(--xh-tree-empty-px, var(--xh-_tree-row-px));
|
|
117
|
+
color: var(--xh-tree-empty-fg, var(--xh-fg-muted));
|
|
118
|
+
font-size: var(--xh-tree-empty-font-size, var(--xh-_tree-font-size));
|
|
119
|
+
line-height: var(--xh-leading-normal);
|
|
88
120
|
text-align: center;
|
|
89
121
|
}
|
|
90
122
|
|
|
@@ -97,17 +129,28 @@
|
|
|
97
129
|
color: var(--xh-fg-disabled);
|
|
98
130
|
}
|
|
99
131
|
|
|
100
|
-
/*
|
|
132
|
+
/* 在途占位:与空态占位同一个位置、同一副排版,两者不同屏。还没有节点时一枚加载环排在文案之前 */
|
|
101
133
|
[data-scope='tree'][data-part='loading'] {
|
|
102
|
-
display:
|
|
134
|
+
display: flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
justify-content: center;
|
|
137
|
+
gap: var(--xh-tree-loading-gap, var(--xh-_tree-row-gap));
|
|
103
138
|
padding-block: var(--xh-tree-loading-py, var(--xh-space-3));
|
|
104
|
-
padding-inline: var(--xh-tree-loading-px, var(--xh-
|
|
105
|
-
color: var(--xh-tree-loading-fg, var(--xh-fg-
|
|
106
|
-
font-size: var(--xh-tree-loading-font-size, var(--xh-
|
|
107
|
-
line-height: var(--xh-leading-
|
|
139
|
+
padding-inline: var(--xh-tree-loading-px, var(--xh-_tree-row-px));
|
|
140
|
+
color: var(--xh-tree-loading-fg, var(--xh-fg-muted));
|
|
141
|
+
font-size: var(--xh-tree-loading-font-size, var(--xh-_tree-font-size));
|
|
142
|
+
line-height: var(--xh-leading-normal);
|
|
108
143
|
text-align: center;
|
|
109
144
|
}
|
|
110
145
|
|
|
146
|
+
/* 环由加载环配方画成(轨道 + 起始边、随 data-loading 淡入并转),这里只给它盒子:直径取尺寸档的图标档 */
|
|
147
|
+
[data-scope='tree'][data-part='loading']::before {
|
|
148
|
+
content: '';
|
|
149
|
+
flex: none;
|
|
150
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
151
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
152
|
+
}
|
|
153
|
+
|
|
111
154
|
[data-scope='tree'][data-part='loading'][hidden] {
|
|
112
155
|
display: none;
|
|
113
156
|
}
|
|
@@ -146,32 +189,32 @@
|
|
|
146
189
|
}
|
|
147
190
|
|
|
148
191
|
/* 行:叶子与分支共用同一套盒子,两种行在视觉上必须齐平。
|
|
149
|
-
行走 Collection Item 的
|
|
150
|
-
|
|
151
|
-
aria-selected / data-selected 与 aria-disabled / data-disabled
|
|
152
|
-
布局保持 flex
|
|
192
|
+
行走 Collection Item 的 overlay 语境,与树选择同一种选中读法:悬停 / 高亮 / 按下面(白底承载
|
|
193
|
+
hover 100 → pressed 200)由家族给,选中不换面、不换字色,只在行尾亮对号,选中叠悬停 / 按下沿用同一条阶梯;
|
|
194
|
+
家族按 aria-selected / data-selected 与 aria-disabled / data-disabled 给出,这里只把公开槽映射到桥接槽。
|
|
195
|
+
布局保持 flex 而不用家族网格:一行里可以并排多个前导部件(箭头、拖拽把手)与作者自己的图标、
|
|
153
196
|
按钮,单列的 prefix 放不下;间距统一由行的 gap 给,家族按槽下发的外边距(--xh-collection-gap)归零 */
|
|
154
197
|
[data-scope='tree'][data-part='item'],
|
|
155
198
|
[data-scope='tree'][data-part='branch-control'] {
|
|
156
|
-
--xh-collection-block-padding: var(--xh-tree-row-py, var(--xh-
|
|
157
|
-
--xh-collection-inline-padding: var(--xh-tree-row-px, var(--xh-
|
|
199
|
+
--xh-collection-block-padding: var(--xh-tree-row-py, var(--xh-_tree-row-py));
|
|
200
|
+
--xh-collection-inline-padding: var(--xh-tree-row-px, var(--xh-_tree-row-px));
|
|
158
201
|
--xh-collection-gap: 0;
|
|
159
|
-
--xh-collection-font-size: var(--xh-tree-row-font-size, var(--xh-
|
|
160
|
-
--xh-collection-radius: var(--xh-tree-row-radius, var(--xh-shape-
|
|
202
|
+
--xh-collection-font-size: var(--xh-tree-row-font-size, var(--xh-_tree-font-size));
|
|
203
|
+
--xh-collection-radius: var(--xh-tree-row-radius, var(--xh-shape-inset));
|
|
161
204
|
/* 作者的图标尺槽经桥接槽下发到行,家族缺省按 md 档 */
|
|
162
205
|
--xh-collection-glyph-size: var(--xh-tree-icon-size, var(--xh-_collection-glyph-size));
|
|
163
|
-
/* 箭头 /
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
--xh-_tree-indicator-size: var(--xh-tree-indicator-size, var(--xh-
|
|
206
|
+
/* 箭头 / 对号盒与叶子的占位同一把尺:指示符档(md comfortable 16 / compact 14),与同一行里的
|
|
207
|
+
拖拽把手同一支。不读家族按档下发的 --xh-icon-size——那支只管作者放进行里的图标,按图标档取的
|
|
208
|
+
20px 会比 16px 的指示符盒大一圈 */
|
|
209
|
+
--xh-_tree-indicator-size: var(--xh-tree-indicator-size, var(--xh-_tree-indicator));
|
|
167
210
|
--xh-collection-fg-rest: var(--xh-tree-row-fg, var(--xh-fg-default));
|
|
168
211
|
--xh-collection-fg-hover: var(--xh-tree-row-fg, var(--xh-fg-default));
|
|
169
212
|
--xh-collection-fg-keyboard-highlight: var(--xh-tree-row-fg, var(--xh-fg-default));
|
|
170
213
|
--xh-collection-fg-pressed: var(--xh-tree-row-fg, var(--xh-fg-default));
|
|
171
|
-
--xh-collection-fg-selected: var(--xh-tree-row-fg-selected, var(--xh-fg-
|
|
172
|
-
--xh-collection-fg-selected-hover: var(--xh-tree-row-fg-selected, var(--xh-fg-
|
|
173
|
-
--xh-collection-fg-selected-highlight: var(--xh-tree-row-fg-selected, var(--xh-fg-
|
|
174
|
-
--xh-collection-fg-selected-pressed: var(--xh-tree-row-fg-selected, var(--xh-fg-
|
|
214
|
+
--xh-collection-fg-selected: var(--xh-tree-row-fg-selected, var(--xh-tree-row-fg, var(--xh-fg-default)));
|
|
215
|
+
--xh-collection-fg-selected-hover: var(--xh-tree-row-fg-selected, var(--xh-tree-row-fg, var(--xh-fg-default)));
|
|
216
|
+
--xh-collection-fg-selected-highlight: var(--xh-tree-row-fg-selected, var(--xh-tree-row-fg, var(--xh-fg-default)));
|
|
217
|
+
--xh-collection-fg-selected-pressed: var(--xh-tree-row-fg-selected, var(--xh-tree-row-fg, var(--xh-fg-default)));
|
|
175
218
|
--xh-collection-font-weight-selected: var(--xh-tree-row-selected-font-weight, var(--xh-font-weight-regular));
|
|
176
219
|
--xh-collection-font-weight-selected-hover: var(--xh-tree-row-selected-font-weight, var(--xh-font-weight-regular));
|
|
177
220
|
--xh-collection-font-weight-selected-highlight: var(--xh-tree-row-selected-font-weight, var(--xh-font-weight-regular));
|
|
@@ -179,11 +222,13 @@
|
|
|
179
222
|
--xh-collection-bg-hover: var(--xh-tree-row-bg-hover, var(--xh-bg-subtle));
|
|
180
223
|
--xh-collection-bg-keyboard-highlight: var(--xh-tree-row-bg-hover, var(--xh-bg-subtle));
|
|
181
224
|
--xh-collection-bg-pressed: var(--xh-tree-row-bg-pressed, var(--xh-bg-subtle-hover));
|
|
182
|
-
--xh-collection-bg-selected: var(--xh-tree-row-bg-
|
|
225
|
+
--xh-collection-bg-selected-hover: var(--xh-tree-row-bg-hover, var(--xh-bg-subtle));
|
|
226
|
+
--xh-collection-bg-selected-highlight: var(--xh-tree-row-bg-hover, var(--xh-bg-subtle));
|
|
227
|
+
--xh-collection-bg-selected-pressed: var(--xh-tree-row-bg-pressed, var(--xh-bg-subtle-hover));
|
|
183
228
|
/* data-highlighted 跟的是连接层记的焦点行(指针点选也会落焦):只换面,焦点环在 :focus-visible 下再接回 */
|
|
184
229
|
--xh-collection-outline-keyboard-highlight: transparent;
|
|
185
230
|
--xh-collection-outline-selected-highlight: transparent;
|
|
186
|
-
/*
|
|
231
|
+
/* 行尾对号:槽按本部件取名(item-check-fg),标记部件的旧槽留在兜底位 */
|
|
187
232
|
--xh-collection-indicator-fg-rest: var(--xh-tree-item-check-fg, var(--xh-tree-item-indicator-fg, var(--xh-fg-brand)));
|
|
188
233
|
--xh-collection-indicator-fg-checked: var(--xh-tree-item-check-fg, var(--xh-tree-item-indicator-fg, var(--xh-fg-brand)));
|
|
189
234
|
--xh-collection-indicator-fg-selected: var(--xh-tree-item-check-fg, var(--xh-tree-item-indicator-fg, var(--xh-fg-brand)));
|
|
@@ -193,29 +238,36 @@
|
|
|
193
238
|
|
|
194
239
|
display: flex;
|
|
195
240
|
align-items: center;
|
|
196
|
-
gap: var(--xh-tree-row-gap, var(--xh-
|
|
241
|
+
gap: var(--xh-tree-row-gap, var(--xh-_tree-row-gap));
|
|
197
242
|
/* 行高留出文字的上下伸展空间,行内那层 overflow:hidden 才不会把字削掉 */
|
|
198
243
|
line-height: var(--xh-tree-row-leading, var(--xh-leading-normal));
|
|
199
244
|
white-space: nowrap;
|
|
200
245
|
user-select: none;
|
|
201
|
-
/*
|
|
202
|
-
换父落点那圈内描边挂在行自己身上,跟着 data-drop
|
|
246
|
+
/* 换面走家族的时间线(按下 press,其余一律 micro,描边色同样不进过渡);box-shadow 一并接过渡:
|
|
247
|
+
换父落点那圈内描边挂在行自己身上,跟着 data-drop 在行间移动。
|
|
248
|
+
translate 是落下后的换位:宿主写回 collection 之后,连接层把行按旧位置反向补偿,这条过渡带它滑到新位置 */
|
|
203
249
|
transition:
|
|
204
|
-
background-color var(--xh-motion-duration-
|
|
250
|
+
background-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
205
251
|
color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
206
|
-
box-shadow var(--xh-motion-duration-micro) var(--xh-motion-ease-enter)
|
|
252
|
+
box-shadow var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
253
|
+
opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
254
|
+
translate var(--xh-motion-duration-move) var(--xh-motion-ease-continuous);
|
|
207
255
|
}
|
|
208
256
|
|
|
209
|
-
/*
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
257
|
+
/* 已有节点时重新取数:不换成占位,行保留上一帧、按 micro 淡到禁用透明度,数据到了再淡回;
|
|
258
|
+
树框(描边与底)不淡,取数在途时行不接指针 */
|
|
259
|
+
[data-scope='tree'][data-part='tree'][data-loading] :is([data-scope='tree'][data-part='item'], [data-scope='tree'][data-part='branch-control']) {
|
|
260
|
+
opacity: var(--xh-tree-row-loading-opacity, var(--xh-state-disabled-opacity));
|
|
261
|
+
pointer-events: none;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/* 分支行的首格是展开箭头,叶子行没有这一格,由行盒自己补出来(对号在行尾,不再替叶子顶这一格),
|
|
265
|
+
否则叶子会比同级分支往行首缩一格,层级关系读不出来。占位宽度与箭头盒同一把尺 */
|
|
266
|
+
[data-orientation='vertical'] > [data-scope='tree'][data-part='item'] {
|
|
215
267
|
padding-inline-start: calc(
|
|
216
|
-
var(--xh-tree-row-px, var(--xh-
|
|
268
|
+
var(--xh-tree-row-px, var(--xh-_tree-row-px)) +
|
|
217
269
|
var(--xh-_tree-indicator-size) +
|
|
218
|
-
var(--xh-tree-row-gap, var(--xh-
|
|
270
|
+
var(--xh-tree-row-gap, var(--xh-_tree-row-gap))
|
|
219
271
|
);
|
|
220
272
|
}
|
|
221
273
|
|
|
@@ -231,7 +283,8 @@
|
|
|
231
283
|
--xh-collection-outline-keyboard-highlight: var(--xh-ring-focus);
|
|
232
284
|
--xh-collection-outline-selected-highlight: var(--xh-ring-focus);
|
|
233
285
|
|
|
234
|
-
|
|
286
|
+
/* 换面即时,只留换位:Alt + 方向键搬的正是这一行,它照样从旧位置滑到新位置 */
|
|
287
|
+
transition: translate var(--xh-motion-duration-move) var(--xh-motion-ease-continuous);
|
|
235
288
|
}
|
|
236
289
|
|
|
237
290
|
/* 禁用走 aria-disabled 而非原生 disabled:叶子的禁用面由家族按 aria-disabled 给;
|
|
@@ -242,76 +295,6 @@
|
|
|
242
295
|
--xh-collection-cursor-rest: not-allowed;
|
|
243
296
|
}
|
|
244
297
|
|
|
245
|
-
/* 勾选把手:勾选态只画在它身上,不碰行底色——底色那条通道归高亮 */
|
|
246
|
-
[data-scope='tree'][data-part='item-checkbox'],
|
|
247
|
-
[data-scope='tree'][data-part='branch-checkbox'] {
|
|
248
|
-
/* 方框里的勾按边长的比例取尺(与 Checkbox 同一比例),不吃家族按档下发的行内字形尺 */
|
|
249
|
-
--xh-icon-size: calc(var(--xh-tree-checkbox-size, var(--xh-control-indicator-size)) * 0.75);
|
|
250
|
-
|
|
251
|
-
display: inline-grid;
|
|
252
|
-
place-items: center;
|
|
253
|
-
flex: none;
|
|
254
|
-
inline-size: var(--xh-tree-checkbox-size, var(--xh-control-indicator-size));
|
|
255
|
-
block-size: var(--xh-tree-checkbox-size, var(--xh-control-indicator-size));
|
|
256
|
-
border: var(--xh-stroke-thin) solid var(--xh-tree-checkbox-border, var(--xh-border-control));
|
|
257
|
-
border-radius: var(--xh-tree-checkbox-radius, var(--xh-shape-inset));
|
|
258
|
-
background: var(--xh-tree-checkbox-bg, transparent);
|
|
259
|
-
color: var(--xh-tree-checkbox-fg, var(--xh-fg-on-brand));
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
[data-scope='tree'][data-part='item-checkbox'][data-selected],
|
|
263
|
-
[data-scope='tree'][data-part='branch-checkbox'][data-selected] {
|
|
264
|
-
border-color: var(--xh-tree-checkbox-border-checked, var(--xh-bg-brand));
|
|
265
|
-
background: var(--xh-tree-checkbox-bg-checked, var(--xh-bg-brand));
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/* 面是实心的,环色与面同族,画在面里就看不出来;环改取面自己的前景色——
|
|
269
|
-
那一族色本来就要在这块面上把字读清楚,与面的对比是按可读性定的。
|
|
270
|
-
勾满与半选铺的是同一块实心底,两态一起收 */
|
|
271
|
-
[data-scope='tree'][data-part='item-checkbox'][data-selected]:focus-visible,
|
|
272
|
-
[data-scope='tree'][data-part='item-checkbox'][data-indeterminate]:focus-visible,
|
|
273
|
-
[data-scope='tree'][data-part='branch-checkbox'][data-selected]:focus-visible,
|
|
274
|
-
[data-scope='tree'][data-part='branch-checkbox'][data-indeterminate]:focus-visible {
|
|
275
|
-
--xh-_ring-color: currentColor;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/* 半选:级联勾选下「子树勾了一部分」的第三态,此前发了 data-indeterminate 却没人画 */
|
|
279
|
-
[data-scope='tree'][data-part='item-checkbox'][data-indeterminate]:not([data-selected]),
|
|
280
|
-
[data-scope='tree'][data-part='branch-checkbox'][data-indeterminate]:not([data-selected]) {
|
|
281
|
-
border-color: var(--xh-tree-checkbox-border-checked, var(--xh-bg-brand));
|
|
282
|
-
background: var(--xh-tree-checkbox-bg-checked, var(--xh-bg-brand));
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
/* 没写内容就由皮肤画;作者往把手里塞了自己的图形,这条规则即不命中 */
|
|
286
|
-
[data-scope='tree'][data-part='item-checkbox'][data-selected]:empty::before,
|
|
287
|
-
[data-scope='tree'][data-part='branch-checkbox'][data-selected]:empty::before {
|
|
288
|
-
content: '';
|
|
289
|
-
display: inline-block;
|
|
290
|
-
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
291
|
-
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
292
|
-
vertical-align: var(--xh-glyph-baseline-shift);
|
|
293
|
-
background-color: currentColor;
|
|
294
|
-
-webkit-mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
295
|
-
mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
[data-scope='tree'][data-part='item-checkbox'][data-indeterminate]:not([data-selected]):empty::before,
|
|
299
|
-
[data-scope='tree'][data-part='branch-checkbox'][data-indeterminate]:not([data-selected]):empty::before {
|
|
300
|
-
content: '';
|
|
301
|
-
display: inline-block;
|
|
302
|
-
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
303
|
-
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
304
|
-
vertical-align: var(--xh-glyph-baseline-shift);
|
|
305
|
-
background-color: currentColor;
|
|
306
|
-
-webkit-mask: var(--xh-glyph-mark-minus) center / contain no-repeat;
|
|
307
|
-
mask: var(--xh-glyph-mark-minus) center / contain no-repeat;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
[data-scope='tree'][data-part='item-checkbox'][data-disabled],
|
|
311
|
-
[data-scope='tree'][data-part='branch-checkbox'][data-disabled] {
|
|
312
|
-
border-color: var(--xh-tree-checkbox-border-disabled, var(--xh-border-default));
|
|
313
|
-
}
|
|
314
|
-
|
|
315
298
|
[data-scope='tree'][data-part='item-text'],
|
|
316
299
|
[data-scope='tree'][data-part='branch-text'] {
|
|
317
300
|
flex: 1;
|
|
@@ -322,14 +305,16 @@
|
|
|
322
305
|
text-overflow: ellipsis;
|
|
323
306
|
}
|
|
324
307
|
|
|
325
|
-
/*
|
|
326
|
-
|
|
308
|
+
/* 选中对号落在行尾,与树选择同位:作者在行里摆在哪儿都排到最后,
|
|
309
|
+
行尾那一格(item-suffix)在它之前;正文吃满剩余宽度,对号因此贴着行的末端。
|
|
310
|
+
未选中时占位不塌,切换选中不引起行宽抖动。盒尺取指示符档;盒里的对号是指示符,
|
|
327
311
|
在自己身上把 --xh-icon-size 改接到盒的尺,兜底对号与作者塞进盒里的 XhIcon 读同一把尺、与盒同边长 */
|
|
328
312
|
[data-scope='tree'][data-part='item-indicator'] {
|
|
329
313
|
--xh-icon-size: var(--xh-_tree-indicator-size);
|
|
330
314
|
|
|
331
315
|
display: inline-flex;
|
|
332
316
|
flex: none;
|
|
317
|
+
order: 1;
|
|
333
318
|
align-items: center;
|
|
334
319
|
justify-content: center;
|
|
335
320
|
inline-size: var(--xh-_tree-indicator-size);
|
|
@@ -339,9 +324,20 @@
|
|
|
339
324
|
display: none;
|
|
340
325
|
}
|
|
341
326
|
|
|
327
|
+
/* 家族只按行的 aria-selected 显示对号:分支行的 aria-selected 在 branch 上、半选没有选中语义,
|
|
328
|
+
这两档按标记自身的 data-selected / data-indeterminate 显形 */
|
|
329
|
+
[data-scope='tree'][data-part='item-indicator']:is([data-selected], [data-indeterminate]) {
|
|
330
|
+
opacity: 1;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/* 分支行的禁用不在行的 aria-disabled 上(那在 branch 上),标记按自身的 data-disabled 降级 */
|
|
334
|
+
[data-scope='tree'][data-part='item-indicator'][data-disabled] {
|
|
335
|
+
color: var(--xh-fg-disabled);
|
|
336
|
+
}
|
|
337
|
+
|
|
342
338
|
/* 展开箭头与方向指示符:两者都可能被作者用作"点这里展开"的把手,
|
|
343
339
|
所以尺寸与叶子的勾选标记一致,两种行的文字起点才对得齐。
|
|
344
|
-
盒里的 chevron
|
|
340
|
+
盒里的 chevron 是指示符:与盒同边长,--xh-icon-size 在自己身上改接到盒的尺 */
|
|
345
341
|
[data-scope='tree'][data-part='branch-trigger'],
|
|
346
342
|
[data-scope='tree'][data-part='branch-indicator'] {
|
|
347
343
|
--xh-icon-size: var(--xh-_tree-indicator-size);
|
|
@@ -352,7 +348,7 @@
|
|
|
352
348
|
justify-content: center;
|
|
353
349
|
inline-size: var(--xh-_tree-indicator-size);
|
|
354
350
|
color: var(--xh-tree-branch-indicator-fg, var(--xh-fg-subtle));
|
|
355
|
-
transition: rotate var(--xh-motion-duration-
|
|
351
|
+
transition: rotate var(--xh-motion-duration-nudge) var(--xh-motion-ease-enter-strong);
|
|
356
352
|
}
|
|
357
353
|
|
|
358
354
|
[data-scope='tree'][data-part='branch-trigger'][hidden],
|
|
@@ -360,20 +356,15 @@
|
|
|
360
356
|
display: none;
|
|
361
357
|
}
|
|
362
358
|
|
|
363
|
-
/*
|
|
364
|
-
rtl
|
|
365
|
-
[data-scope='tree'][data-part='branch-trigger']
|
|
366
|
-
[data-scope='tree'][data-part='branch-indicator']
|
|
367
|
-
rotate: 90deg;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
[dir='rtl'] [data-scope='tree'][data-part='branch-trigger'],
|
|
371
|
-
[dir='rtl'] [data-scope='tree'][data-part='branch-indicator'] {
|
|
372
|
-
rotate: 180deg;
|
|
359
|
+
/* 收起时指向行尾、展开时转向下方,与逻辑书写方向一致:rtl 下行尾在左侧,收起的箭头转半圈;
|
|
360
|
+
旋转角乘书写方向的符号(ltr 0deg、rtl 180deg),按就近的 dir 走 */
|
|
361
|
+
[data-scope='tree'][data-part='branch-trigger'],
|
|
362
|
+
[data-scope='tree'][data-part='branch-indicator'] {
|
|
363
|
+
rotate: calc(90deg - 90deg * var(--xh-direction-sign));
|
|
373
364
|
}
|
|
374
365
|
|
|
375
|
-
[
|
|
376
|
-
[
|
|
366
|
+
[data-scope='tree'][data-part='branch-trigger'][data-state='open'],
|
|
367
|
+
[data-scope='tree'][data-part='branch-indicator'][data-state='open'] {
|
|
377
368
|
rotate: 90deg;
|
|
378
369
|
}
|
|
379
370
|
|
|
@@ -388,7 +379,31 @@
|
|
|
388
379
|
display: flex;
|
|
389
380
|
flex-direction: column;
|
|
390
381
|
gap: var(--xh-tree-branch-content-gap, var(--xh-list-option-gap));
|
|
391
|
-
padding-inline-start: var(--xh-tree-indent, var(--xh-
|
|
382
|
+
padding-inline-start: var(--xh-tree-indent, var(--xh-_tree-indent));
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/*
|
|
386
|
+
* 缩进参考线:每一层子节点的行首画一道竖线,对齐父节点展开箭头的中线,层级深时一眼看得出谁跟谁同层。
|
|
387
|
+
* 线画在子层容器自己的伪元素上:定位在子层里,只贯穿这一层的全部子孙,不越出父节点的范围。
|
|
388
|
+
* 它是内部分隔的一种,颜色取 border-subtle;行悬停与选中换面时线压在面上照样看得见
|
|
389
|
+
*/
|
|
390
|
+
[data-scope='tree'][data-part='tree'][data-lines] [data-scope='tree'][data-part='branch-content'] {
|
|
391
|
+
position: relative;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
[data-scope='tree'][data-part='tree'][data-lines] [data-scope='tree'][data-part='branch-content']::before {
|
|
395
|
+
content: '';
|
|
396
|
+
position: absolute;
|
|
397
|
+
inset-block: 0;
|
|
398
|
+
/* 父行的行首内边距加半个箭头盒:竖线正好落在父节点展开箭头的中线上 */
|
|
399
|
+
inset-inline-start: calc(
|
|
400
|
+
var(--xh-tree-row-px, var(--xh-_tree-row-px)) +
|
|
401
|
+
var(--xh-tree-indicator-size, var(--xh-_tree-indicator)) / 2 -
|
|
402
|
+
var(--xh-stroke-thin) / 2
|
|
403
|
+
);
|
|
404
|
+
inline-size: var(--xh-stroke-thin);
|
|
405
|
+
background: var(--xh-tree-line-color, var(--xh-border-subtle));
|
|
406
|
+
pointer-events: none;
|
|
392
407
|
}
|
|
393
408
|
|
|
394
409
|
/* 末端那一层横排:子节点并排铺开、必要时折行。缩进照旧由子层容器自己顶——
|
|
@@ -426,6 +441,8 @@
|
|
|
426
441
|
mask: var(--xh-glyph-mark-chevron-right) center / contain no-repeat;
|
|
427
442
|
}
|
|
428
443
|
|
|
444
|
+
/* 勾与半选杠叠成两层遮罩,按状态只换两层的尺寸:离开半选淡出的那一段里横杠留着,
|
|
445
|
+
淡出播完才换回勾——不在淡出途中闪出一枚勾 */
|
|
429
446
|
[data-scope='tree'][data-part='item-indicator']:empty::before {
|
|
430
447
|
content: '';
|
|
431
448
|
display: inline-block;
|
|
@@ -433,8 +450,48 @@
|
|
|
433
450
|
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
434
451
|
vertical-align: var(--xh-glyph-baseline-shift);
|
|
435
452
|
background-color: currentColor;
|
|
436
|
-
-webkit-mask: var(--xh-glyph-mark-check) center /
|
|
437
|
-
mask: var(--xh-glyph-mark-check) center /
|
|
453
|
+
-webkit-mask: var(--xh-glyph-mark-check) center / 100% 100% no-repeat, var(--xh-glyph-mark-minus) center / 0 0 no-repeat;
|
|
454
|
+
mask: var(--xh-glyph-mark-check) center / 100% 100% no-repeat, var(--xh-glyph-mark-minus) center / 0 0 no-repeat;
|
|
455
|
+
transition:
|
|
456
|
+
-webkit-mask-size 0s var(--xh-motion-duration-micro),
|
|
457
|
+
mask-size 0s var(--xh-motion-duration-micro);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
[data-scope='tree'][data-part='item-indicator'][data-selected]:empty::before {
|
|
461
|
+
transition-delay: 0s;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
[data-scope='tree'][data-part='item-indicator'][data-indeterminate]:not([data-selected]):empty::before {
|
|
465
|
+
-webkit-mask-size: 0 0, 100% 100%;
|
|
466
|
+
mask-size: 0 0, 100% 100%;
|
|
467
|
+
transition-delay: 0s;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/* 这一枝在取子节点:展开箭头换成转圈,不再按开合转向;只换字形,颜色沿用箭头的弱前景 */
|
|
471
|
+
[data-scope='tree'][data-part='branch'][data-loading] > [data-scope='tree'][data-part='branch-control'] [data-scope='tree'][data-part='branch-trigger'],
|
|
472
|
+
[data-scope='tree'][data-part='branch'][data-loading] > [data-scope='tree'][data-part='branch-control'] [data-scope='tree'][data-part='branch-indicator'] {
|
|
473
|
+
rotate: none;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
[data-scope='tree'][data-part='branch'][data-loading] > [data-scope='tree'][data-part='branch-control'] [data-scope='tree'][data-part='branch-trigger']:empty::before,
|
|
477
|
+
[data-scope='tree'][data-part='branch'][data-loading] > [data-scope='tree'][data-part='branch-control'] [data-scope='tree'][data-part='branch-indicator']:empty::before {
|
|
478
|
+
-webkit-mask-image: var(--xh-glyph-mark-rotate-right);
|
|
479
|
+
mask-image: var(--xh-glyph-mark-rotate-right);
|
|
480
|
+
animation: xh-spin var(--xh-motion-loop-spin) var(--xh-motion-ease-loop) infinite;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/* 减少动效:转圈停下,静止的箭头仍然读得出「还没好」,在途由分支的 aria-busy 念出。
|
|
484
|
+
两组规则是同一件事的两个触发条件:系统偏好与作者打的 data-motion */
|
|
485
|
+
@media (prefers-reduced-motion: reduce) {
|
|
486
|
+
[data-scope='tree'][data-part='branch'][data-loading] > [data-scope='tree'][data-part='branch-control'] [data-scope='tree'][data-part='branch-trigger']:empty::before,
|
|
487
|
+
[data-scope='tree'][data-part='branch'][data-loading] > [data-scope='tree'][data-part='branch-control'] [data-scope='tree'][data-part='branch-indicator']:empty::before {
|
|
488
|
+
animation: none;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
:where([data-motion='reduce']) [data-scope='tree'][data-part='branch'][data-loading] > [data-scope='tree'][data-part='branch-control'] [data-scope='tree'][data-part='branch-trigger']:empty::before,
|
|
493
|
+
:where([data-motion='reduce']) [data-scope='tree'][data-part='branch'][data-loading] > [data-scope='tree'][data-part='branch-control'] [data-scope='tree'][data-part='branch-indicator']:empty::before {
|
|
494
|
+
animation: none;
|
|
438
495
|
}
|
|
439
496
|
|
|
440
497
|
/* —— 节点拖拽搬家 —— */
|
|
@@ -455,8 +512,8 @@
|
|
|
455
512
|
flex: none;
|
|
456
513
|
align-items: center;
|
|
457
514
|
justify-content: center;
|
|
458
|
-
inline-size: var(--xh-tree-drag-size, var(--xh-
|
|
459
|
-
block-size: var(--xh-tree-drag-size, var(--xh-
|
|
515
|
+
inline-size: var(--xh-tree-drag-size, var(--xh-_tree-indicator));
|
|
516
|
+
block-size: var(--xh-tree-drag-size, var(--xh-_tree-indicator));
|
|
460
517
|
border-radius: var(--xh-tree-drag-radius, var(--xh-shape-control));
|
|
461
518
|
color: var(--xh-tree-drag-fg, var(--xh-fg-subtle));
|
|
462
519
|
cursor: grab;
|
|
@@ -520,7 +577,7 @@
|
|
|
520
577
|
position: absolute;
|
|
521
578
|
inset-inline: 0;
|
|
522
579
|
block-size: var(--xh-tree-drop-line, var(--xh-stroke-thick));
|
|
523
|
-
background: var(--xh-tree-drop-fg, var(--xh-
|
|
580
|
+
background: var(--xh-tree-drop-fg, var(--xh-bg-brand));
|
|
524
581
|
}
|
|
525
582
|
|
|
526
583
|
/* 落在上沿还是下沿走逻辑属性,块向跟着书写模式走。
|
|
@@ -542,10 +599,10 @@
|
|
|
542
599
|
禁用的节点从来不做落点,这一段因此不会漏画任何一处高亮 */
|
|
543
600
|
[data-scope='tree'][data-part='item'][data-drop='inside']:not([data-disabled]),
|
|
544
601
|
[data-scope='tree'][data-part='branch-control'][data-drop='inside']:not([data-disabled]) {
|
|
545
|
-
/* 落点不是选中:品牌淡底专属选中 /
|
|
602
|
+
/* 落点不是选中:品牌淡底专属选中 / 当前,落点面取悬停之上一档的中性面 */
|
|
546
603
|
background: var(--xh-tree-drop-inside-bg, var(--xh-bg-subtle-hover));
|
|
547
604
|
box-shadow: inset 0 0 0 var(--xh-tree-drop-line, var(--xh-stroke-thick))
|
|
548
|
-
var(--xh-tree-drop-fg, var(--xh-
|
|
605
|
+
var(--xh-tree-drop-fg, var(--xh-bg-brand));
|
|
549
606
|
}
|
|
550
607
|
|
|
551
608
|
/* 活动区域只说给读屏听,不占版面。声明与 shared/visually-hidden.ts 逐条同值。 */
|
|
@@ -561,10 +618,46 @@
|
|
|
561
618
|
border: 0;
|
|
562
619
|
}
|
|
563
620
|
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
621
|
+
@media print {
|
|
622
|
+
/* 打印默认丢底色,而对号与半选杠是遮罩出来的一块底色:行本就不换面,丢了它选中在纸上就没了踪影 */
|
|
623
|
+
[data-scope='tree'][data-part='item-indicator'] {
|
|
624
|
+
print-color-adjust: exact;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/* 转了一半的圈定格在纸上没有意义,停下 */
|
|
628
|
+
[data-scope='tree'][data-part='branch'][data-loading] > [data-scope='tree'][data-part='branch-control'] [data-scope='tree'][data-part='branch-trigger']:empty::before,
|
|
629
|
+
[data-scope='tree'][data-part='branch'][data-loading] > [data-scope='tree'][data-part='branch-control'] [data-scope='tree'][data-part='branch-indicator']:empty::before {
|
|
630
|
+
animation: none;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/* 强制色:参考线是一块底色,系统色下会被抹成 Canvas;换成 GrayText 并只让这条线不参与强制换色 */
|
|
635
|
+
@media (forced-colors: active) {
|
|
636
|
+
[data-scope='tree'][data-part='tree'][data-lines] [data-scope='tree'][data-part='branch-content']::before {
|
|
637
|
+
background: GrayText;
|
|
638
|
+
forced-color-adjust: none;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
@media (forced-colors: active) {
|
|
643
|
+
/* 兜底字形是 mask 挖出来的一块底色,这一档里底色被系统换成 Canvas,字形跟着消失。
|
|
644
|
+
字形退出强制换色、直接写系统色(不能取 currentColor:退出强制换色的伪元素读到的是被系统换掉之前的作者色):
|
|
645
|
+
条目面上取 CanvasText;按下与没被高亮时的悬停,家族把条目涂成 Highlight,字形换 HighlightText;
|
|
646
|
+
禁用取 GrayText */
|
|
647
|
+
[data-scope='tree']:is([data-part='branch-trigger'], [data-part='branch-indicator']):empty::before,
|
|
648
|
+
[data-scope='tree'][data-part='item-indicator']:empty::before {
|
|
649
|
+
forced-color-adjust: none;
|
|
650
|
+
background-color: CanvasText;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
[data-scope='tree'][data-part='branch-control']:not([aria-disabled='true'], [data-disabled], [aria-busy='true'], [data-error]):is(:active, [data-pressed], :hover:not(:focus-visible, [data-highlighted])) [data-scope='tree']:is([data-part='branch-trigger'], [data-part='branch-indicator']):empty::before,
|
|
654
|
+
[data-scope='tree'][data-part='item']:not([aria-disabled='true'], [data-disabled], [aria-busy='true'], [data-error]):is(:active, [data-pressed], :hover:not(:focus-visible, [data-highlighted])) [data-scope='tree'][data-part='item-indicator']:empty::before {
|
|
655
|
+
background-color: HighlightText;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
[data-scope='tree'][data-part='branch-control']:is([aria-disabled='true'], [data-disabled]) [data-scope='tree']:is([data-part='branch-trigger'], [data-part='branch-indicator']):empty::before,
|
|
659
|
+
[data-scope='tree'][data-part='item']:is([aria-disabled='true'], [data-disabled]) [data-scope='tree'][data-part='item-indicator']:empty::before {
|
|
660
|
+
background-color: GrayText;
|
|
661
|
+
}
|
|
569
662
|
}
|
|
570
663
|
}
|