@xihan-ui/styles 2.1.0 → 3.1.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 +1261 -0
- package/README.md +6 -1
- package/component-tokens.d.ts +533 -96
- package/components.tokens.json +35461 -26045
- package/css/accordion.css +34 -8
- package/css/alert.css +59 -1
- package/css/anchor.css +46 -8
- package/css/approval.css +116 -76
- package/css/avatar-group.css +1 -1
- package/css/avatar.css +13 -5
- package/css/back-top.css +61 -42
- package/css/badge.css +62 -12
- package/css/bar-code.css +1 -1
- package/css/breadcrumb.css +62 -3
- package/css/button-group.css +4 -4
- package/css/button.css +67 -19
- package/css/calendar-picker.css +19 -0
- package/css/calendar-range-picker.css +39 -2
- package/css/card.css +115 -1
- package/css/carousel.css +148 -43
- package/css/cartesian-chart.css +830 -0
- package/css/cascader.css +181 -65
- package/css/checkbox-group.css +59 -89
- package/css/checkbox.css +16 -49
- package/css/citation.css +470 -0
- package/css/clipboard.css +20 -63
- package/css/code-view.css +101 -6
- package/css/collapsible.css +34 -8
- package/css/color-field.css +18 -0
- package/css/color-picker.css +128 -50
- package/css/color-slider.css +22 -15
- package/css/color-swatch-picker.css +3 -1
- package/css/combobox.css +80 -33
- package/css/command.css +45 -43
- package/css/context-menu.css +39 -22
- package/css/date-field.css +56 -0
- package/css/date-picker.css +132 -26
- package/css/date-range-picker.css +337 -14
- package/css/description.css +17 -1
- package/css/descriptions.css +42 -0
- package/css/dialog.css +94 -36
- package/css/diff-view.css +97 -12
- package/css/download-trigger.css +44 -78
- package/css/drawer.css +160 -119
- package/css/editable.css +19 -0
- package/css/empty-state.css +7 -6
- package/css/field-array.css +36 -0
- package/css/field.css +20 -18
- package/css/file-upload.css +125 -135
- package/css/flex.css +324 -8
- package/css/float-button.css +263 -38
- package/css/floating-panel.css +53 -19
- package/css/form.css +31 -17
- 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 +31 -14
- package/css/icon.css +100 -0
- package/css/image-cropper.css +33 -7
- package/css/image-viewer.css +167 -22
- package/css/image.css +23 -4
- package/css/input-group.css +11 -13
- package/css/json-viewer.css +50 -2
- package/css/layout.css +68 -18
- package/css/liquid.css +106 -0
- package/css/list.css +1 -1
- package/css/listbox.css +46 -6
- package/css/loading-bar.css +27 -13
- package/css/log.css +129 -33
- 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 -19
- package/css/menu.css +35 -21
- package/css/menubar.css +36 -20
- package/css/message-feed.css +172 -51
- package/css/navigation-menu.css +172 -11
- package/css/notification.css +435 -108
- package/css/number-field.css +22 -0
- package/css/page-header.css +3 -1
- package/css/pagination.css +126 -24
- package/css/password-input.css +40 -8
- package/css/pie-chart.css +247 -0
- package/css/popconfirm.css +44 -50
- package/css/popover.css +50 -14
- package/css/progress.css +308 -10
- package/css/prompt-input.css +36 -0
- package/css/question-flow.css +97 -57
- package/css/radar-chart.css +233 -0
- package/css/radio-group.css +363 -5
- package/css/rating.css +21 -23
- package/css/reasoning.css +61 -54
- 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 +74 -55
- package/css/side-nav.css +173 -24
- package/css/signature-pad.css +16 -1
- package/css/skeleton.css +13 -14
- package/css/slider.css +35 -13
- package/css/sortable.css +37 -7
- package/css/sparkline.css +164 -0
- package/css/spinner.css +50 -22
- package/css/splitter.css +7 -1
- package/css/statistic.css +10 -0
- package/css/steps.css +248 -29
- package/css/switch.css +23 -48
- package/css/table.css +175 -118
- package/css/tabs.css +231 -19
- package/css/tag-group.css +27 -3
- package/css/tag.css +53 -12
- 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 +103 -17
- package/css/time-range-picker.css +45 -16
- package/css/timeline.css +1 -1
- package/css/toggle-group.css +4 -4
- package/css/toggle.css +4 -3
- package/css/tool-call.css +59 -51
- package/css/toolbar.css +101 -3
- package/css/tooltip.css +15 -2
- package/css/tour.css +42 -12
- package/css/transfer.css +98 -75
- package/css/tree-select.css +232 -53
- package/css/tree.css +271 -55
- package/css/truncate.css +55 -12
- package/css/typography.css +93 -0
- package/css/virtualizer.css +56 -0
- 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 +9 -15
- 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 +207 -10
- package/family/tag-list.css +59 -0
- package/index.css +13824 -4030
- package/index.unlayered.css +13403 -3605
- 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/checkbox.css
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
/* 定义 checkbox 样式。 */
|
|
7
7
|
|
|
8
8
|
@import '../family/action-control.css';
|
|
9
|
+
@import '../family/check-mark.css';
|
|
9
10
|
|
|
10
11
|
@layer xihan.components {
|
|
11
12
|
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
@@ -155,61 +156,28 @@
|
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
158
|
|
|
159
|
+
/* 指示器铺满方框。勾与半选杠由勾选标记配方画在它的 ::before 上(常驻、按状态淡变并轻缩放);
|
|
160
|
+
作者往部件里塞了自己的图形时配方不画 */
|
|
158
161
|
[data-scope='checkbox'][data-part='indicator'] {
|
|
159
162
|
display: inline-flex;
|
|
160
163
|
align-items: center;
|
|
161
164
|
justify-content: center;
|
|
162
165
|
inline-size: 100%;
|
|
163
166
|
block-size: 100%;
|
|
164
|
-
opacity: 0;
|
|
165
167
|
line-height: var(--xh-leading-none);
|
|
166
168
|
font-size: var(--xh-_checkbox-glyph);
|
|
167
169
|
pointer-events: none;
|
|
168
|
-
scale: var(--xh-motion-scale-enter);
|
|
169
|
-
transition:
|
|
170
|
-
opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
171
|
-
scale var(--xh-motion-duration-micro) var(--xh-motion-ease-enter-strong);
|
|
172
170
|
}
|
|
173
171
|
|
|
174
|
-
/*
|
|
175
|
-
[data-scope='checkbox'][data-part='indicator']:empty::before {
|
|
176
|
-
content: '';
|
|
177
|
-
display: inline-block;
|
|
178
|
-
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
179
|
-
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
180
|
-
vertical-align: var(--xh-glyph-baseline-shift);
|
|
181
|
-
background-color: currentColor;
|
|
182
|
-
-webkit-mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
183
|
-
mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
[data-scope='checkbox'][data-part='indicator']:is([data-state='checked'], [data-state='indeterminate']) {
|
|
187
|
-
opacity: 1;
|
|
188
|
-
scale: 1;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/* 半选换一枚横杠字形盖住勾:aria-checked=mixed 在视觉上也得与「全选」分得开。
|
|
192
|
-
横杠与勾同走字形令牌,作者换掉标记时两态一起换;此前这条是手画的几何盒
|
|
193
|
-
(60% × stroke-thick),同一页上会出现两种横杠 */
|
|
172
|
+
/* 半选横杠另有一支前景槽,缺省与勾同色 */
|
|
194
173
|
[data-scope='checkbox'][data-part='indicator'][data-state='indeterminate'] {
|
|
195
|
-
|
|
196
|
-
color: transparent;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
[data-scope='checkbox'][data-part='indicator'][data-state='indeterminate']::after {
|
|
200
|
-
position: absolute;
|
|
201
|
-
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
202
|
-
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
203
|
-
background-color: var(--xh-checkbox-indicator-fg, var(--xh-_checkbox-on-accent));
|
|
204
|
-
content: '';
|
|
205
|
-
-webkit-mask: var(--xh-glyph-mark-minus) center / contain no-repeat;
|
|
206
|
-
mask: var(--xh-glyph-mark-minus) center / contain no-repeat;
|
|
174
|
+
--xh-check-mark-fg: var(--xh-checkbox-indicator-fg, var(--xh-_checkbox-on-accent));
|
|
207
175
|
}
|
|
208
176
|
|
|
209
|
-
/*
|
|
177
|
+
/* 禁用时横杠也走置灰色 */
|
|
210
178
|
[data-scope='checkbox'][data-part='root'][data-disabled]
|
|
211
|
-
[data-scope='checkbox'][data-part='indicator'][data-state='indeterminate']
|
|
212
|
-
|
|
179
|
+
[data-scope='checkbox'][data-part='indicator'][data-state='indeterminate'] {
|
|
180
|
+
--xh-check-mark-fg: var(--xh-checkbox-fg-disabled, var(--xh-fg-disabled));
|
|
213
181
|
}
|
|
214
182
|
|
|
215
183
|
/* —— 带文字的整行:<label> 包住控件与文字,与 checkbox-group 的条目、switch 的标签同一副样子 ——
|
|
@@ -259,18 +227,17 @@
|
|
|
259
227
|
}
|
|
260
228
|
|
|
261
229
|
@media (forced-colors: active) {
|
|
262
|
-
/* 真实 border
|
|
263
|
-
|
|
264
|
-
[data-scope='checkbox'][data-part='indicator'][data-state='indeterminate']::after {
|
|
265
|
-
background-color: CanvasText;
|
|
266
|
-
}
|
|
267
|
-
|
|
230
|
+
/* 真实 border 保住盒,勾与半选横杠的系统前景由配方给;禁用写在 root 上,指示器自己不带,这里补置灰。
|
|
231
|
+
盒就是 root 本身:悬停与按下时家族把它涂成 Highlight,勾跟着换 HighlightText */
|
|
268
232
|
[data-scope='checkbox'][data-part='root'][data-disabled]
|
|
269
|
-
[data-scope='checkbox'][data-part='indicator']:empty::before
|
|
270
|
-
[data-scope='checkbox'][data-part='root'][data-disabled]
|
|
271
|
-
[data-scope='checkbox'][data-part='indicator'][data-state='indeterminate']::after {
|
|
233
|
+
[data-scope='checkbox'][data-part='indicator']:empty::before {
|
|
272
234
|
background-color: GrayText;
|
|
273
235
|
}
|
|
236
|
+
|
|
237
|
+
[data-scope='checkbox'][data-part='root']:not([data-disabled]):not([data-loading]):is(:hover, :active, [data-pressed])
|
|
238
|
+
[data-scope='checkbox'][data-part='indicator']:empty::before {
|
|
239
|
+
background-color: HighlightText;
|
|
240
|
+
}
|
|
274
241
|
}
|
|
275
242
|
|
|
276
243
|
@media print {
|
package/css/citation.css
ADDED
|
@@ -0,0 +1,470 @@
|
|
|
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
|
+
/* 定义 citation 样式。 */
|
|
7
|
+
|
|
8
|
+
@import '../family/action-control.css';
|
|
9
|
+
/* hover 档的卡片:共享关键帧与 frosted 材质配方 */
|
|
10
|
+
@import '../family/motion.css';
|
|
11
|
+
@import '../family/material.css';
|
|
12
|
+
|
|
13
|
+
@layer xihan.motion {
|
|
14
|
+
/* 预览的披露:内容区高度从 0 长到连接层量下的那一版,内缩与描边一起长回来,
|
|
15
|
+
它前面那道间距由负的上外距从抵消状态放开;收起反过来收回 0 */
|
|
16
|
+
@keyframes xh-citation-preview-expand {
|
|
17
|
+
from {
|
|
18
|
+
block-size: 0;
|
|
19
|
+
padding-block: 0;
|
|
20
|
+
border-block-width: 0;
|
|
21
|
+
margin-block-start: calc(-1 * var(--xh-_citation-preview-gap));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
to {
|
|
25
|
+
block-size: var(--xh-_citation-preview-block-size);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@keyframes xh-citation-preview-collapse {
|
|
30
|
+
from {
|
|
31
|
+
block-size: var(--xh-_citation-preview-block-size);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
to {
|
|
35
|
+
block-size: 0;
|
|
36
|
+
padding-block: 0;
|
|
37
|
+
border-block-width: 0;
|
|
38
|
+
margin-block-start: calc(-1 * var(--xh-_citation-preview-gap));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@layer xihan.components {
|
|
44
|
+
[data-scope='citation'] {
|
|
45
|
+
--xh-citation-skin: 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* 尺寸档的私有槽写在根上,也写在 hover 档的定位壳上:它被搬到 portal 落点后继承不到根上的值 */
|
|
49
|
+
[data-scope='citation']:is([data-part='root'], [data-part='positioner']) {
|
|
50
|
+
--xh-_citation-gap: var(--xh-space-3);
|
|
51
|
+
--xh-_citation-pad: var(--xh-surface-pad-md);
|
|
52
|
+
--xh-_citation-font-size: var(--xh-control-font-md);
|
|
53
|
+
--xh-_citation-icon-size: var(--xh-glyph-size-md);
|
|
54
|
+
--xh-icon-size: var(--xh-citation-icon-size, var(--xh-_citation-icon-size));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
[data-scope='citation'][data-part='root'] {
|
|
58
|
+
/* 纵向一列:预览展开的首帧用负的上外距抵掉它前面那道间距,flex 里负外距会把后面的内容一起拉回来 */
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
gap: var(--xh-citation-gap, var(--xh-_citation-gap));
|
|
62
|
+
color: var(--xh-citation-fg, var(--xh-fg-default));
|
|
63
|
+
font-size: var(--xh-citation-font-size, var(--xh-_citation-font-size));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* 禁用降前景:正文落到禁用色,不靠整体透明度(编号的面与字由家族的禁用档给) */
|
|
67
|
+
[data-scope='citation'][data-part='root'][data-disabled] [data-scope='citation'][data-part='text'] {
|
|
68
|
+
color: var(--xh-fg-disabled);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[data-scope='citation'][data-part='text'] {
|
|
72
|
+
display: inline;
|
|
73
|
+
color: var(--xh-citation-text-fg, var(--xh-fg-default));
|
|
74
|
+
line-height: var(--xh-text-prose-leading);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* 引用编号跟正文同排,是一个一维引用对象:用 pill 把短编号包成稳定目标。 */
|
|
78
|
+
[data-scope='citation'][data-part='trigger'] {
|
|
79
|
+
--xh-action-visual-size: var(--xh-citation-trigger-h, var(--xh-space-6));
|
|
80
|
+
--xh-action-min-inline-size: var(--xh-citation-trigger-h, var(--xh-space-6));
|
|
81
|
+
--xh-action-padding-inline: var(--xh-citation-trigger-px, var(--xh-space-1));
|
|
82
|
+
--xh-action-radius: var(--xh-citation-trigger-radius, var(--xh-shape-pill));
|
|
83
|
+
--xh-action-font-size: var(--xh-citation-trigger-font-size, var(--xh-text-caption-size));
|
|
84
|
+
--xh-action-fg-rest: var(--xh-citation-trigger-fg, var(--xh-fg-brand));
|
|
85
|
+
--xh-action-fg-hover: var(--xh-citation-trigger-fg, var(--xh-fg-brand));
|
|
86
|
+
--xh-action-fg-pressed: var(--xh-citation-trigger-fg, var(--xh-fg-brand));
|
|
87
|
+
|
|
88
|
+
margin-inline: var(--xh-citation-trigger-margin, var(--xh-space-0_5));
|
|
89
|
+
vertical-align: text-top;
|
|
90
|
+
font-variant-numeric: tabular-nums;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* 打开中不是选中:与悬停同档的中性面,悬停不再加深,按下照常走下一档 */
|
|
94
|
+
[data-scope='citation'][data-part='trigger'][data-state='open'] {
|
|
95
|
+
--xh-action-bg-rest: var(--xh-_action-variant-bg-hover);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
[data-scope='citation'][data-part='preview'] {
|
|
99
|
+
display: grid;
|
|
100
|
+
gap: var(--xh-citation-preview-gap, var(--xh-space-3));
|
|
101
|
+
padding-block: var(--xh-citation-preview-py, var(--xh-_citation-pad));
|
|
102
|
+
padding-inline: var(--xh-citation-preview-px, var(--xh-_citation-pad));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* inline 档:预览是正文流里的静态 surface,不漂浮、不盖住正文。
|
|
106
|
+
开合是 surface 级披露:高度按内容区(content-box)动,展开与收起途中把长出盒外的内容裁掉。
|
|
107
|
+
hover 档的预览带 data-xh-material,面交给材质配方画 */
|
|
108
|
+
[data-scope='citation'][data-part='preview']:not([data-xh-material]) {
|
|
109
|
+
/* 根上那道间距:展开与收起时用负外距抵掉它 */
|
|
110
|
+
--xh-_citation-preview-gap: var(--xh-citation-gap, var(--xh-_citation-gap));
|
|
111
|
+
|
|
112
|
+
box-sizing: content-box;
|
|
113
|
+
overflow: clip;
|
|
114
|
+
border: var(--xh-stroke-thin) solid var(--xh-citation-preview-border, var(--xh-border-default));
|
|
115
|
+
border-radius: var(--xh-citation-preview-radius, var(--xh-shape-surface));
|
|
116
|
+
background: var(--xh-citation-preview-bg, var(--xh-bg-surface));
|
|
117
|
+
color: var(--xh-citation-preview-fg, var(--xh-fg-default));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* 展开与收起只在开合时播:首帧就开着的预览直接呈现(data-instant)。
|
|
121
|
+
收起时连接层押后 hidden,收回 0 播完才藏起;forwards 把末态钉住,免得播完到藏起之间弹回原样。
|
|
122
|
+
减弱动效下两支披露时长瞬时完成 */
|
|
123
|
+
[data-scope='citation'][data-part='preview'][data-preview-mode='inline'][data-state='open']:not([data-instant]) {
|
|
124
|
+
animation: xh-citation-preview-expand var(--xh-motion-duration-expand) var(--xh-motion-ease-enter-strong);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
[data-scope='citation'][data-part='preview'][data-preview-mode='inline'][data-state='closed']:not([data-instant]) {
|
|
128
|
+
animation: xh-citation-preview-collapse var(--xh-motion-duration-collapse) var(--xh-motion-ease-exit) forwards;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* 定位壳:inline 档不参与排版,里面的预览照常在正文流里 */
|
|
132
|
+
[data-scope='citation'][data-part='positioner'][data-preview-mode='inline'] {
|
|
133
|
+
display: contents;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* hover 档:坐标由定位引擎写进 style(left / top),这里只定位模式与层级 */
|
|
137
|
+
[data-scope='citation'][data-part='positioner'][data-preview-mode='hover'] {
|
|
138
|
+
/* 落定那一侧的可用高度与宽度,由定位引擎经内联自定义属性写进来,卡片据此限高限宽;
|
|
139
|
+
引擎没算(尚未落位 / 无引擎 / 贴边归零)时退到视口 */
|
|
140
|
+
--xh-_citation-available-h: 100vh;
|
|
141
|
+
--xh-_citation-available-w: 100vw;
|
|
142
|
+
|
|
143
|
+
position: fixed;
|
|
144
|
+
z-index: var(--xh-citation-layer, var(--xh-_layer, var(--xh-layer-popover)));
|
|
145
|
+
font-size: var(--xh-citation-font-size, var(--xh-_citation-font-size));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* 锚点被滚出可视区:卡片随之收起 */
|
|
149
|
+
[data-scope='citation'][data-part='positioner'][data-hidden] {
|
|
150
|
+
visibility: hidden;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
[data-scope='citation'][data-part='positioner'][hidden] {
|
|
154
|
+
display: none;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* 缩放原点与进场位移按落定的那一侧给:卡片从贴着引用编号的那条边涨开。两个槽由预览继承;
|
|
158
|
+
placement 是物理方向,origin 与 translate 也是物理量,不随书写方向翻 */
|
|
159
|
+
[data-scope='citation'][data-part='positioner'][data-placement^='top'] {
|
|
160
|
+
--xh-_overlay-origin-y: 100%;
|
|
161
|
+
--xh-_overlay-enter-down: 1;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
[data-scope='citation'][data-part='positioner'][data-placement^='bottom'] {
|
|
165
|
+
--xh-_overlay-origin-y: 0;
|
|
166
|
+
--xh-_overlay-enter-up: 1;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
[data-scope='citation'][data-part='positioner'][data-placement^='left'] {
|
|
170
|
+
--xh-_overlay-origin-x: 100%;
|
|
171
|
+
--xh-_overlay-enter-right: 1;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
[data-scope='citation'][data-part='positioner'][data-placement^='right'] {
|
|
175
|
+
--xh-_overlay-origin-x: 0;
|
|
176
|
+
--xh-_overlay-enter-left: 1;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* hover 档的预览是锚定面板:材质家族配方画 frosted 面(描边、底、1px 顶光、前景、投影与背景滤镜),
|
|
180
|
+
这里只把使用者槽接进来;形状取 overlay,内容长了在卡片里滚 */
|
|
181
|
+
[data-scope='citation'][data-part='preview'][data-preview-mode='hover'] {
|
|
182
|
+
--xh-frosted-bg: var(--xh-citation-card-bg, var(--xh-_material-bg));
|
|
183
|
+
--xh-frosted-border: var(--xh-citation-card-border, var(--xh-_material-border));
|
|
184
|
+
--xh-frosted-fg: var(--xh-citation-card-fg, var(--xh-_material-fg));
|
|
185
|
+
--xh-frosted-shadow: var(--xh-citation-card-shadow, var(--xh-_material-shadow));
|
|
186
|
+
--xh-frosted-backdrop: var(--xh-citation-card-backdrop, var(--xh-_material-backdrop));
|
|
187
|
+
|
|
188
|
+
box-sizing: border-box;
|
|
189
|
+
inline-size: max-content;
|
|
190
|
+
max-inline-size: min(var(--xh-citation-card-max-w, var(--xh-overlay-max-w)), var(--xh-_citation-available-w));
|
|
191
|
+
max-block-size: min(var(--xh-citation-card-max-h, var(--xh-overlay-max-h)), var(--xh-_citation-available-h));
|
|
192
|
+
/* 卡片不做滚动面:引文收到有限几行,全文经打开来源的链接看 */
|
|
193
|
+
overflow: clip;
|
|
194
|
+
border-radius: var(--xh-citation-card-radius, var(--xh-shape-overlay));
|
|
195
|
+
transform-origin: var(--xh-_overlay-origin-x, 50%) var(--xh-_overlay-origin-y, 50%);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* hover 档的引文按行数裁,裁掉的那一行末尾收省略号 */
|
|
199
|
+
[data-scope='citation'][data-part='preview'][data-preview-mode='hover'] [data-scope='citation'][data-part='quote']:not([hidden]) {
|
|
200
|
+
display: -webkit-box;
|
|
201
|
+
overflow: hidden;
|
|
202
|
+
-webkit-box-orient: vertical;
|
|
203
|
+
-webkit-line-clamp: var(--xh-citation-card-quote-lines, 6);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* 出现与退场按锚定面板那一组:开着时 pop-in,收起时 pop-out 播完才藏起;卡片里轮换来源不再播 */
|
|
207
|
+
[data-scope='citation'][data-part='preview'][data-preview-mode='hover'][data-state='open']:not([data-instant]) {
|
|
208
|
+
animation: xh-overlay-pop-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
[data-scope='citation'][data-part='preview'][data-preview-mode='hover'][data-state='closed']:not([data-instant]) {
|
|
212
|
+
animation: xh-pop-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* 一处多源的轮换:两颗翻页钮夹着位置,排在收起钮之前 */
|
|
216
|
+
[data-scope='citation'][data-part='prev-trigger'],
|
|
217
|
+
[data-scope='citation'][data-part='next-trigger'] {
|
|
218
|
+
--xh-action-padding-inline: 0;
|
|
219
|
+
--xh-action-radius: var(--xh-citation-pager-radius, var(--xh-shape-control));
|
|
220
|
+
flex: none;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
[data-scope='citation'][data-part='prev-trigger']:empty::before,
|
|
224
|
+
[data-scope='citation'][data-part='next-trigger']:empty::before {
|
|
225
|
+
content: '';
|
|
226
|
+
display: inline-block;
|
|
227
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
228
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
229
|
+
background-color: currentColor;
|
|
230
|
+
-webkit-mask: var(--xh-glyph-mark-chevron-left) center / contain no-repeat;
|
|
231
|
+
mask: var(--xh-glyph-mark-chevron-left) center / contain no-repeat;
|
|
232
|
+
/* 上一个指向行首、下一个指向行尾:RTL 下水平翻过来 */
|
|
233
|
+
scale: var(--xh-direction-sign) 1;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
[data-scope='citation'][data-part='next-trigger']:empty::before {
|
|
237
|
+
-webkit-mask-image: var(--xh-glyph-mark-chevron-right);
|
|
238
|
+
mask-image: var(--xh-glyph-mark-chevron-right);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
[data-scope='citation'][data-part='preview-index'] {
|
|
242
|
+
flex: none;
|
|
243
|
+
align-self: center;
|
|
244
|
+
color: var(--xh-citation-meta-fg, var(--xh-fg-muted));
|
|
245
|
+
font-size: var(--xh-citation-meta-font-size, var(--xh-text-caption-size));
|
|
246
|
+
font-variant-numeric: tabular-nums;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
[data-scope='citation'][data-part='prev-trigger'][hidden],
|
|
250
|
+
[data-scope='citation'][data-part='next-trigger'][hidden],
|
|
251
|
+
[data-scope='citation'][data-part='preview-index'][hidden] {
|
|
252
|
+
display: none;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
[data-scope='citation'][data-part='preview'][hidden] {
|
|
256
|
+
display: none;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
[data-scope='citation'][data-part='preview-header'] {
|
|
260
|
+
display: flex;
|
|
261
|
+
align-items: flex-start;
|
|
262
|
+
justify-content: space-between;
|
|
263
|
+
gap: var(--xh-citation-preview-header-gap, var(--xh-space-3));
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
[data-scope='citation'][data-part='preview-header'] > :first-child {
|
|
267
|
+
display: grid;
|
|
268
|
+
flex: 1;
|
|
269
|
+
gap: var(--xh-citation-preview-header-content-gap, var(--xh-space-0_5));
|
|
270
|
+
min-inline-size: 0;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
[data-scope='citation'][data-part='preview-title'] {
|
|
274
|
+
overflow: hidden;
|
|
275
|
+
color: var(--xh-citation-title-fg, var(--xh-fg-default));
|
|
276
|
+
font-size: var(--xh-citation-title-font-size, var(--xh-text-label-size));
|
|
277
|
+
font-weight: var(--xh-citation-title-font-weight, var(--xh-font-weight-semibold));
|
|
278
|
+
text-overflow: ellipsis;
|
|
279
|
+
white-space: nowrap;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
[data-scope='citation'][data-part='preview-meta'],
|
|
283
|
+
[data-scope='citation'][data-part='source-meta'] {
|
|
284
|
+
overflow: hidden;
|
|
285
|
+
color: var(--xh-citation-meta-fg, var(--xh-fg-muted));
|
|
286
|
+
font-size: var(--xh-citation-meta-font-size, var(--xh-text-caption-size));
|
|
287
|
+
text-overflow: ellipsis;
|
|
288
|
+
white-space: nowrap;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
[data-scope='citation'][data-part='quote'] {
|
|
292
|
+
margin: 0;
|
|
293
|
+
padding-inline-start: var(--xh-citation-quote-ps, var(--xh-space-3));
|
|
294
|
+
border-inline-start: var(--xh-stroke-thick) solid var(--xh-citation-quote-border, var(--xh-fg-brand));
|
|
295
|
+
color: var(--xh-citation-quote-fg, var(--xh-fg-muted));
|
|
296
|
+
font-size: var(--xh-citation-quote-font-size, var(--xh-text-secondary-size));
|
|
297
|
+
line-height: var(--xh-text-prose-leading);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
[data-scope='citation'][data-part='quote'][hidden] {
|
|
301
|
+
display: none;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/* 预览面里的收起钮与其它面板内的关闭钮同一身份:控件圆角 */
|
|
305
|
+
[data-scope='citation'][data-part='dismiss-trigger'] {
|
|
306
|
+
--xh-action-padding-inline: 0;
|
|
307
|
+
--xh-action-radius: var(--xh-citation-dismiss-trigger-radius, var(--xh-shape-control));
|
|
308
|
+
flex: none;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
[data-scope='citation'][data-part='dismiss-trigger']:empty::before {
|
|
312
|
+
content: '';
|
|
313
|
+
display: inline-block;
|
|
314
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
315
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
316
|
+
background-color: currentColor;
|
|
317
|
+
-webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
318
|
+
mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
[data-scope='citation'][data-part='preview-link'] {
|
|
322
|
+
inline-size: fit-content;
|
|
323
|
+
color: var(--xh-citation-link-fg, var(--xh-fg-brand));
|
|
324
|
+
font-weight: var(--xh-text-label-weight);
|
|
325
|
+
text-decoration: none;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
[data-scope='citation'][data-part='preview-link']:is(:hover, :focus-visible) {
|
|
329
|
+
text-decoration: underline;
|
|
330
|
+
text-underline-offset: var(--xh-space-1);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
[data-scope='citation'][data-part='preview-link']:focus-visible {
|
|
334
|
+
border-radius: var(--xh-citation-preview-link-radius, var(--xh-shape-control));
|
|
335
|
+
outline: var(--xh-ring-width) solid var(--xh-ring-focus);
|
|
336
|
+
outline-offset: var(--xh-ring-offset);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
[data-scope='citation'][data-part='list'] {
|
|
340
|
+
display: grid;
|
|
341
|
+
gap: var(--xh-citation-list-gap, var(--xh-space-1));
|
|
342
|
+
margin: 0;
|
|
343
|
+
padding: 0;
|
|
344
|
+
list-style: none;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
[data-scope='citation'][data-part='source'] {
|
|
348
|
+
display: block;
|
|
349
|
+
min-inline-size: 0;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
[data-scope='citation'][data-part='source-link'] {
|
|
353
|
+
--xh-action-padding-inline: var(--xh-citation-source-px, var(--xh-space-3));
|
|
354
|
+
--xh-action-padding-block: var(--xh-citation-source-py, var(--xh-space-2));
|
|
355
|
+
--xh-action-radius: var(--xh-citation-source-radius, var(--xh-shape-control));
|
|
356
|
+
--xh-action-fg-rest: var(--xh-citation-source-fg, var(--xh-fg-default));
|
|
357
|
+
|
|
358
|
+
display: grid;
|
|
359
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
360
|
+
align-items: start;
|
|
361
|
+
text-align: start;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
[data-scope='citation'][data-part='source-link'][data-current] {
|
|
365
|
+
--xh-action-bg-rest: var(--xh-bg-brand-subtle);
|
|
366
|
+
--xh-action-bg-hover: var(--xh-bg-brand-subtle);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
[data-scope='citation'][data-part='source-link'] > :last-child {
|
|
370
|
+
display: grid;
|
|
371
|
+
gap: var(--xh-citation-source-link-content-gap, var(--xh-space-0_5));
|
|
372
|
+
min-inline-size: 0;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
[data-scope='citation'][data-part='source-index'] {
|
|
376
|
+
display: inline-flex;
|
|
377
|
+
align-items: center;
|
|
378
|
+
justify-content: center;
|
|
379
|
+
min-inline-size: var(--xh-citation-index-size, var(--xh-control-box-sm));
|
|
380
|
+
block-size: var(--xh-citation-index-size, var(--xh-control-box-sm));
|
|
381
|
+
border-radius: var(--xh-citation-index-radius, var(--xh-shape-circle));
|
|
382
|
+
background: var(--xh-citation-index-bg, var(--xh-bg-subtle));
|
|
383
|
+
color: var(--xh-citation-index-fg, var(--xh-fg-muted));
|
|
384
|
+
font-size: var(--xh-citation-index-font-size, var(--xh-text-caption-size));
|
|
385
|
+
font-variant-numeric: tabular-nums;
|
|
386
|
+
transition:
|
|
387
|
+
background-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
388
|
+
color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
[data-scope='citation'][data-part='source'][data-state='active'] [data-part='source-index'] {
|
|
392
|
+
background: var(--xh-citation-index-active-bg, var(--xh-bg-brand));
|
|
393
|
+
color: var(--xh-citation-index-active-fg, var(--xh-fg-on-brand));
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
[data-scope='citation'][data-part='source-title'] {
|
|
397
|
+
overflow: hidden;
|
|
398
|
+
color: var(--xh-citation-source-title-fg, var(--xh-fg-default));
|
|
399
|
+
font-weight: var(--xh-text-label-weight);
|
|
400
|
+
text-overflow: ellipsis;
|
|
401
|
+
white-space: nowrap;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
[data-scope='citation']:is([data-part='root'], [data-part='positioner'])[data-size='sm'] {
|
|
405
|
+
--xh-_citation-gap: var(--xh-space-2);
|
|
406
|
+
--xh-_citation-pad: var(--xh-surface-pad-sm);
|
|
407
|
+
--xh-_citation-font-size: var(--xh-control-font-sm);
|
|
408
|
+
--xh-_citation-icon-size: var(--xh-glyph-size-sm);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
[data-scope='citation']:is([data-part='root'], [data-part='positioner'])[data-size='lg'] {
|
|
412
|
+
--xh-_citation-gap: var(--xh-space-4);
|
|
413
|
+
--xh-_citation-pad: var(--xh-surface-pad-lg);
|
|
414
|
+
--xh-_citation-font-size: var(--xh-control-font-lg);
|
|
415
|
+
--xh-_citation-icon-size: var(--xh-glyph-size-lg);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
@media (forced-colors: active) {
|
|
419
|
+
[data-scope='citation'][data-part='source'][data-state='active'] [data-part='source-index'] {
|
|
420
|
+
background: Highlight;
|
|
421
|
+
color: HighlightText;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
@media print {
|
|
426
|
+
[data-scope='citation'][data-part='dismiss-trigger'],
|
|
427
|
+
[data-scope='citation'][data-part='prev-trigger'],
|
|
428
|
+
[data-scope='citation'][data-part='next-trigger'] {
|
|
429
|
+
display: none;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/* 悬停卡片是瞬态浮层,打印时不出现 */
|
|
433
|
+
[data-scope='citation'][data-part='positioner'][data-preview-mode='hover'] {
|
|
434
|
+
display: none;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
[data-scope='citation'][data-part='preview-link'] {
|
|
438
|
+
color: currentColor;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
[data-scope='citation'][data-part='root'][hidden],
|
|
443
|
+
[data-scope='citation'][data-part='text'][hidden],
|
|
444
|
+
[data-scope='citation'][data-part='preview-header'][hidden],
|
|
445
|
+
[data-scope='citation'][data-part='list'][hidden],
|
|
446
|
+
[data-scope='citation'][data-part='source'][hidden],
|
|
447
|
+
[data-scope='citation'][data-part='source-link'][hidden],
|
|
448
|
+
[data-scope='citation'][data-part='source-index'][hidden] {
|
|
449
|
+
display: none;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
@media (forced-colors: active) {
|
|
453
|
+
/* 兜底字形是 mask 挖出来的一块底色,这一档里底色被系统换成 Canvas,字形跟着消失。
|
|
454
|
+
字形退出强制换色、直接写系统色(不能取 currentColor:退出强制换色的伪元素读到的是被系统换掉之前的作者色):
|
|
455
|
+
按钮面上取 ButtonText,悬停与按下时家族把按钮涂成 Highlight、字形换 HighlightText;
|
|
456
|
+
禁用取 GrayText */
|
|
457
|
+
[data-scope='citation']:is([data-part='prev-trigger'], [data-part='next-trigger'], [data-part='dismiss-trigger']):empty::before {
|
|
458
|
+
forced-color-adjust: none;
|
|
459
|
+
background-color: ButtonText;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
[data-scope='citation']:is([data-part='prev-trigger'], [data-part='next-trigger'], [data-part='dismiss-trigger']):not([data-disabled]):not([data-loading]):is(:hover, :active, [data-pressed]):empty::before {
|
|
463
|
+
background-color: HighlightText;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
[data-scope='citation']:is([data-part='prev-trigger'], [data-part='next-trigger'], [data-part='dismiss-trigger'])[data-disabled]:empty::before {
|
|
467
|
+
background-color: GrayText;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|