@xihan-ui/styles 3.1.0 → 4.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 +470 -0
- package/component-tokens.d.ts +230 -60
- package/components.tokens.json +5156 -1557
- package/css/accordion.css +47 -20
- package/css/alert.css +16 -17
- package/css/anchor.css +2 -2
- package/css/approval.css +41 -17
- package/css/avatar-group.css +9 -12
- package/css/avatar.css +20 -18
- package/css/back-top.css +21 -7
- package/css/badge.css +5 -5
- package/css/breadcrumb.css +18 -16
- package/css/button-group.css +4 -6
- package/css/button.css +13 -12
- package/css/calendar-picker.css +178 -95
- package/css/calendar-range-picker.css +207 -122
- package/css/card.css +34 -6
- package/css/carousel.css +94 -46
- package/css/cartesian-chart.css +11 -11
- package/css/cascader.css +51 -39
- package/css/checkbox-group.css +9 -6
- package/css/checkbox.css +5 -4
- package/css/citation.css +9 -4
- package/css/clipboard.css +20 -4
- package/css/code-view.css +6 -6
- package/css/collapsible.css +29 -14
- package/css/color-field.css +4 -4
- package/css/color-picker.css +77 -23
- package/css/color-slider.css +10 -8
- package/css/color-swatch-picker.css +14 -9
- package/css/combobox.css +26 -14
- package/css/command.css +14 -9
- package/css/context-menu.css +10 -5
- package/css/date-field.css +12 -6
- package/css/date-picker.css +178 -109
- package/css/date-range-picker.css +199 -130
- package/css/description.css +10 -6
- package/css/descriptions.css +47 -19
- package/css/dialog.css +50 -35
- package/css/diff-view.css +8 -8
- package/css/drawer.css +75 -21
- package/css/editable.css +15 -41
- package/css/empty-state.css +21 -3
- package/css/field-array.css +5 -2
- package/css/field.css +17 -18
- package/css/fieldset.css +33 -13
- package/css/file-upload.css +66 -33
- package/css/float-button.css +60 -35
- package/css/floating-panel.css +1 -1
- package/css/form.css +30 -16
- package/css/graph-chart.css +2 -2
- package/css/grid-list.css +1 -1
- package/css/highlight.css +5 -5
- package/css/hover-card.css +19 -12
- package/css/image-viewer.css +77 -27
- package/css/image.css +13 -5
- package/css/infinite-scroll.css +8 -4
- package/css/input-group.css +74 -26
- package/css/kbd.css +1 -1
- package/css/label.css +27 -11
- package/css/layout.css +17 -10
- package/css/list.css +13 -9
- package/css/listbox.css +12 -7
- package/css/loading-bar.css +3 -0
- package/css/mention.css +11 -9
- package/css/menu.css +10 -5
- package/css/menubar.css +13 -8
- package/css/message-feed.css +1 -1
- package/css/navigation-menu.css +2 -2
- package/css/notification.css +132 -49
- package/css/number-animation.css +2 -2
- package/css/number-field.css +75 -52
- package/css/page-header.css +64 -27
- package/css/pagination.css +35 -38
- package/css/password-input.css +12 -68
- package/css/pin-input.css +18 -26
- package/css/popconfirm.css +23 -14
- package/css/popover.css +18 -12
- package/css/progress.css +14 -13
- package/css/prompt-input.css +3 -3
- package/css/question-flow.css +41 -15
- package/css/radar-chart.css +6 -6
- package/css/radio-group.css +120 -55
- package/css/rating.css +32 -15
- package/css/select.css +16 -12
- package/css/separator.css +24 -6
- package/css/side-nav.css +29 -24
- package/css/signature-pad.css +23 -9
- package/css/skeleton.css +12 -12
- package/css/slider.css +77 -48
- package/css/sortable.css +2 -2
- package/css/sparkline.css +8 -2
- package/css/spinner.css +40 -20
- package/css/statistic.css +14 -14
- package/css/steps.css +115 -84
- package/css/switch.css +9 -7
- package/css/table.css +29 -12
- package/css/tabs.css +35 -12
- package/css/tag-group.css +17 -6
- package/css/tag.css +54 -29
- package/css/tags-input.css +39 -20
- package/css/text-field.css +5 -5
- package/css/time-field.css +4 -4
- package/css/time-picker.css +150 -64
- package/css/time-range-picker.css +91 -62
- package/css/timeline.css +37 -20
- package/css/timer.css +3 -3
- package/css/toggle-group.css +4 -4
- package/css/tool-call.css +13 -11
- package/css/toolbar.css +6 -5
- package/css/tooltip.css +16 -17
- package/css/tour.css +14 -7
- package/css/transfer.css +22 -16
- package/css/tree-select.css +12 -12
- package/css/tree.css +26 -25
- package/css/typography.css +28 -25
- package/dist/css/accordion.css +296 -0
- package/dist/css/affix.css +47 -0
- package/dist/css/alert.css +246 -0
- package/dist/css/anchor.css +252 -0
- package/dist/css/approval.css +525 -0
- package/dist/css/avatar-group.css +96 -0
- package/dist/css/avatar.css +100 -0
- package/dist/css/back-top.css +175 -0
- package/dist/css/badge.css +205 -0
- package/dist/css/bar-code.css +62 -0
- package/dist/css/breadcrumb.css +232 -0
- package/dist/css/button-group.css +261 -0
- package/dist/css/button.css +216 -0
- package/dist/css/calendar-picker.css +550 -0
- package/dist/css/calendar-range-picker.css +639 -0
- package/dist/css/card.css +249 -0
- package/dist/css/carousel.css +726 -0
- package/dist/css/cartesian-chart.css +830 -0
- package/dist/css/cascader.css +973 -0
- package/dist/css/checkbox-group.css +361 -0
- package/dist/css/checkbox.css +258 -0
- package/dist/css/citation.css +475 -0
- package/dist/css/clipboard.css +331 -0
- package/dist/css/code-view.css +374 -0
- package/dist/css/collapsible.css +200 -0
- package/dist/css/color-field.css +176 -0
- package/dist/css/color-picker.css +649 -0
- package/dist/css/color-slider.css +283 -0
- package/dist/css/color-swatch-picker.css +250 -0
- package/dist/css/color-swatch.css +35 -0
- package/dist/css/combobox.css +578 -0
- package/dist/css/command.css +404 -0
- package/dist/css/context-menu.css +425 -0
- package/dist/css/date-field.css +317 -0
- package/dist/css/date-picker.css +931 -0
- package/dist/css/date-range-picker.css +949 -0
- package/dist/css/description.css +71 -0
- package/dist/css/descriptions.css +327 -0
- package/dist/css/dialog.css +470 -0
- package/dist/css/diff-view.css +513 -0
- package/dist/css/download-trigger.css +151 -0
- package/dist/css/drawer.css +606 -0
- package/dist/css/editable.css +269 -0
- package/dist/css/empty-state.css +181 -0
- package/dist/css/field-array.css +229 -0
- package/dist/css/field.css +165 -0
- package/dist/css/fieldset.css +122 -0
- package/dist/css/file-upload.css +462 -0
- package/dist/css/flex.css +441 -0
- package/dist/css/float-button.css +579 -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 +407 -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 +233 -0
- package/dist/css/icon.css +225 -0
- package/dist/css/image-cropper.css +373 -0
- package/dist/css/image-viewer.css +588 -0
- package/dist/css/image.css +106 -0
- package/dist/css/infinite-scroll.css +81 -0
- package/dist/css/input-group.css +323 -0
- package/dist/css/json-viewer.css +379 -0
- package/dist/css/kbd.css +72 -0
- package/dist/css/label.css +94 -0
- package/dist/css/layers.css +7 -0
- package/dist/css/layout.css +379 -0
- package/dist/css/liquid.css +106 -0
- package/dist/css/list.css +156 -0
- package/dist/css/listbox.css +395 -0
- package/dist/css/loading-bar.css +144 -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 +395 -0
- package/dist/css/menu.css +369 -0
- package/dist/css/menubar.css +461 -0
- package/dist/css/message-feed.css +318 -0
- package/dist/css/navigation-menu.css +513 -0
- package/dist/css/notification.css +865 -0
- package/dist/css/number-animation.css +44 -0
- package/dist/css/number-field.css +275 -0
- package/dist/css/overlay-arrow.css +56 -0
- package/dist/css/page-header.css +221 -0
- package/dist/css/pagination.css +447 -0
- package/dist/css/password-input.css +335 -0
- package/dist/css/pie-chart.css +247 -0
- package/dist/css/pin-input.css +191 -0
- package/dist/css/pointer.css +36 -0
- package/dist/css/popconfirm.css +329 -0
- package/dist/css/popover.css +285 -0
- package/dist/css/progress.css +502 -0
- package/dist/css/prompt-input.css +260 -0
- package/dist/css/question-flow.css +579 -0
- package/dist/css/radar-chart.css +233 -0
- package/dist/css/radio-group.css +663 -0
- package/dist/css/rating.css +311 -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 +616 -0
- package/dist/css/separator.css +140 -0
- package/dist/css/side-nav.css +481 -0
- package/dist/css/signature-pad.css +193 -0
- package/dist/css/skeleton.css +161 -0
- package/dist/css/slider.css +403 -0
- package/dist/css/sortable.css +228 -0
- package/dist/css/sparkline.css +170 -0
- package/dist/css/spinner.css +256 -0
- package/dist/css/splitter.css +159 -0
- package/dist/css/statistic.css +137 -0
- package/dist/css/steps.css +658 -0
- package/dist/css/switch.css +353 -0
- package/dist/css/table.css +1162 -0
- package/dist/css/tabs.css +967 -0
- package/dist/css/tag-group.css +258 -0
- package/dist/css/tag.css +335 -0
- package/dist/css/tags-input.css +341 -0
- package/dist/css/text-field.css +197 -0
- package/dist/css/time-field.css +277 -0
- package/dist/css/time-picker.css +793 -0
- package/dist/css/time-range-picker.css +775 -0
- package/dist/css/timeline.css +440 -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 +431 -0
- package/dist/css/toolbar.css +366 -0
- package/dist/css/tooltip.css +217 -0
- package/dist/css/tour.css +446 -0
- package/dist/css/transfer.css +644 -0
- package/dist/css/tree-select.css +878 -0
- package/dist/css/tree.css +734 -0
- package/dist/css/truncate.css +108 -0
- package/dist/css/typography.css +475 -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 +493 -0
- package/dist/family/chart.css +537 -0
- package/dist/family/check-mark.css +94 -0
- package/dist/family/choice-card.css +97 -0
- package/dist/family/collection-item.css +768 -0
- package/dist/family/field-chrome.css +296 -0
- package/dist/family/loading-ring.css +102 -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 +65 -0
- package/family/action-control.css +33 -36
- package/family/chart.css +57 -0
- package/family/collection-item.css +12 -8
- package/family/field-chrome.css +28 -19
- package/family/loading-ring.css +20 -13
- package/family/swatch.css +4 -4
- package/family/tag-list.css +6 -0
- package/index.css +10349 -8756
- package/index.unlayered.css +10350 -8758
- package/package.json +165 -164
|
@@ -0,0 +1,588 @@
|
|
|
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
|
+
/* 定义 image viewer 样式。 */
|
|
7
|
+
|
|
8
|
+
@import '../family/action-control.css';
|
|
9
|
+
@import '../family/loading-ring.css';
|
|
10
|
+
|
|
11
|
+
/* 共享关键帧由 family/motion.css 提供,本皮肤 @import 它,单独引入仍成立。 */
|
|
12
|
+
@import '../family/motion.css';
|
|
13
|
+
|
|
14
|
+
@layer xihan.components {
|
|
15
|
+
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
16
|
+
.xh-scope-image-viewer {
|
|
17
|
+
--xh-image-viewer-skin: 1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.xh-scope-image-viewer[data-part='backdrop'] {
|
|
21
|
+
position: fixed;
|
|
22
|
+
inset: 0;
|
|
23
|
+
z-index: var(--xh-image-viewer-backdrop-layer, var(--xh-_layer, var(--xh-layer-modal)));
|
|
24
|
+
/* 与对话框同一层全局遮罩:看片台的深浅由遮罩令牌统一定 */
|
|
25
|
+
background: var(--xh-image-viewer-backdrop-bg, var(--xh-bg-overlay));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* 同一层底色之上再糊背后的页面 */
|
|
29
|
+
.xh-scope-image-viewer[data-part='backdrop'][data-variant='blur'] {
|
|
30
|
+
-webkit-backdrop-filter: blur(var(--xh-image-viewer-backdrop-blur, var(--xh-overlay-backdrop-blur)));
|
|
31
|
+
backdrop-filter: blur(var(--xh-image-viewer-backdrop-blur, var(--xh-overlay-backdrop-blur)));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* 去掉底色,只留下这一层吃指针:交互外关闭与滚动锁定照旧 */
|
|
35
|
+
.xh-scope-image-viewer[data-part='backdrop'][data-variant='transparent'] {
|
|
36
|
+
background: transparent;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.xh-scope-image-viewer[data-part='backdrop'][data-state='open']:not([data-instant]) {
|
|
40
|
+
animation: xh-fade-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.xh-scope-image-viewer[data-part='backdrop'][data-state='closed'] {
|
|
44
|
+
animation: xh-fade-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.xh-scope-image-viewer[data-part='positioner'] {
|
|
48
|
+
/* 工具条是页面主题的实体面,看片层(content)却整层是白墨域:页面主题下的面色、描边与字色
|
|
49
|
+
在域外的这一层取一次,交给工具条 */
|
|
50
|
+
--xh-_image-viewer-page-surface: var(--xh-bg-surface);
|
|
51
|
+
--xh-_image-viewer-page-border: var(--xh-border-default);
|
|
52
|
+
--xh-_image-viewer-page-fg: var(--xh-fg-muted);
|
|
53
|
+
|
|
54
|
+
position: fixed;
|
|
55
|
+
inset: 0;
|
|
56
|
+
z-index: var(--xh-image-viewer-layer, var(--xh-_layer, var(--xh-layer-modal)));
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.xh-scope-image-viewer[data-part='content'] {
|
|
63
|
+
/* 组件内那几档层号只在自己人之间排序:建一个层叠上下文把它们关起来,
|
|
64
|
+
既不让页面上的层号插进来,也不让它们漏出去压住别人 */
|
|
65
|
+
isolation: isolate;
|
|
66
|
+
|
|
67
|
+
/* 作者塞进浮层的图标:内容层给一档 md 的尺,十颗钮各自再按 Action Control 档位覆盖 */
|
|
68
|
+
--xh-icon-size: var(--xh-image-viewer-icon-size, var(--xh-glyph-size-md));
|
|
69
|
+
/* 翻页钮、关闭钮与计数共用的深色 chrome:压在使用者的图片上的半透明深底,取画面控件面那组令牌,
|
|
70
|
+
不取页面语义面。白面压在亮图上分不出来(白 30% 的面压亮图不到 1.4:1),这几件留在深纱上 */
|
|
71
|
+
--xh-_image-viewer-chrome-bg: var(--xh-image-viewer-chrome-bg, var(--xh-bg-media-chrome));
|
|
72
|
+
--xh-_image-viewer-chrome-bg-hover: var(--xh-image-viewer-action-bg-hover, var(--xh-bg-media-chrome-hover));
|
|
73
|
+
--xh-_image-viewer-chrome-bg-active: var(--xh-image-viewer-action-bg-active, var(--xh-bg-media-chrome-active));
|
|
74
|
+
|
|
75
|
+
position: relative;
|
|
76
|
+
inline-size: 100%;
|
|
77
|
+
block-size: 100%;
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
outline: none;
|
|
82
|
+
/* 深色底上的工具条与计数固定用浅字,不随主题翻 */
|
|
83
|
+
color: var(--xh-image-viewer-fg, var(--xh-fg-on-media-chrome));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* 挂载时就开着的那一段(data-instant)属于首帧,直接呈现 */
|
|
87
|
+
.xh-scope-image-viewer[data-part='content'][data-state='open']:not([data-instant]) {
|
|
88
|
+
animation: xh-fade-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.xh-scope-image-viewer[data-part='content'][data-state='closed'] {
|
|
92
|
+
animation: xh-fade-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.xh-scope-image-viewer[data-part='viewport'] {
|
|
96
|
+
position: absolute;
|
|
97
|
+
inset: 0;
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
cursor: grab;
|
|
103
|
+
/* 平移与滚轮都归指针会话,浏览器手势不抢 */
|
|
104
|
+
touch-action: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.xh-scope-image-viewer[data-part='viewport'][data-dragging] {
|
|
108
|
+
cursor: grabbing;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* 原图还在路上:指针先报出来,此刻拖也没有东西可拖 */
|
|
112
|
+
.xh-scope-image-viewer[data-part='viewport'][data-loading] {
|
|
113
|
+
cursor: progress;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* 取图期间画面正中一枚加载环:不给的话打开一张几 MB 的原图,台前是一整块什么都没有的暗底,
|
|
117
|
+
用户分不清是在加载还是这张图坏了。环由加载环配方画(连接层投影 data-xh-loading-ring),
|
|
118
|
+
随 data-loading 淡入淡出;前景随看片层的白墨域 */
|
|
119
|
+
.xh-scope-image-viewer[data-part='viewport'] {
|
|
120
|
+
/* 画面正中那两枚状态图形(加载环与警示字形)的尺:看片台是整幅画面,取控件图标档的最大一档 */
|
|
121
|
+
--xh-icon-size: var(--xh-image-viewer-status-size, var(--xh-glyph-size-lg));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.xh-scope-image-viewer[data-part='viewport']::before {
|
|
125
|
+
content: '';
|
|
126
|
+
position: absolute;
|
|
127
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
128
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* 取图失败:画面正中一枚警示字形(取危险色,非颜色通道),替掉浏览器画的破图与替代文字 */
|
|
132
|
+
.xh-scope-image-viewer[data-part='viewport'][data-error]::after {
|
|
133
|
+
content: '';
|
|
134
|
+
position: absolute;
|
|
135
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
136
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
137
|
+
background-color: var(--xh-image-viewer-error-fg, var(--xh-fg-danger));
|
|
138
|
+
-webkit-mask: var(--xh-glyph-mark-warning) center / contain no-repeat;
|
|
139
|
+
mask: var(--xh-glyph-mark-warning) center / contain no-repeat;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.xh-scope-image-viewer[data-part='image'] {
|
|
143
|
+
max-inline-size: 90%;
|
|
144
|
+
max-block-size: 85%;
|
|
145
|
+
user-select: none;
|
|
146
|
+
/* 位移、旋转与缩放都是内联 style 写的,只给按钮带来的缩放旋转一点缓动;拖拽平移要跟手,不缓。
|
|
147
|
+
新图取到之后淡入 */
|
|
148
|
+
transition:
|
|
149
|
+
translate var(--xh-motion-duration-nudge) var(--xh-motion-ease-continuous),
|
|
150
|
+
rotate var(--xh-motion-duration-nudge) var(--xh-motion-ease-continuous),
|
|
151
|
+
scale var(--xh-motion-duration-nudge) var(--xh-motion-ease-continuous),
|
|
152
|
+
opacity var(--xh-motion-duration-enter) var(--xh-motion-ease-enter);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* 取图期间(打开与换下标):换图那一刻变换直接归位、不补间——转过、放大过的旧图不当着用户转回、缩回;
|
|
156
|
+
旧图随即让位,视口垫着的占位面顶上,不露底色闪一拍。取到之后撤掉这一档,按上面的进场档淡入 */
|
|
157
|
+
.xh-scope-image-viewer[data-part='image'][data-loading] {
|
|
158
|
+
opacity: 0;
|
|
159
|
+
transition: none;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* 载不出来的图不露浏览器的破图:整张让位给视口正中的警示字形,替代文字仍在可及树里 */
|
|
163
|
+
.xh-scope-image-viewer[data-part='image'][data-error] {
|
|
164
|
+
visibility: hidden;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* 拖拽期间平移每帧都在改:只在这一档备好合成层,松手后随 data-dragging 一起撤掉 */
|
|
168
|
+
.xh-scope-image-viewer[data-part='image'][data-dragging] {
|
|
169
|
+
transition: none;
|
|
170
|
+
will-change: translate;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* 松手后弹簧带着平移惯性滑行、越出范围时回弹,同样逐帧写变换,不能再叠一层过渡;落定即撤 */
|
|
174
|
+
.xh-scope-image-viewer[data-part='image'][data-animating] {
|
|
175
|
+
transition: none;
|
|
176
|
+
will-change: translate;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* —— 悬浮件 ——
|
|
180
|
+
四件都钉在铺满视口的那一层的边上,贴边一律与安全区取大的一头:刘海、圆角与
|
|
181
|
+
底部横条压住的那一段由系统给出,贴边比它窄时钮会被切掉一角;桌面上 env() 恒为 0。
|
|
182
|
+
安全区只有物理方向的四个名字,行内轴上两侧同取较宽的那一段,RTL 下不会翻错边。
|
|
183
|
+
工具条是容器、计数是一行字的气泡,各按身份取圆角(surface / control),
|
|
184
|
+
--xh-image-viewer-overlay-radius 仍是两者共用的使用者入口;翻页钮的面走下面的桥接槽 */
|
|
185
|
+
.xh-scope-image-viewer[data-part='toolbar'],
|
|
186
|
+
.xh-scope-image-viewer[data-part='counter'] {
|
|
187
|
+
position: absolute;
|
|
188
|
+
z-index: 1;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* 计数:一行浅字压在深纱上 */
|
|
192
|
+
.xh-scope-image-viewer[data-part='counter'] {
|
|
193
|
+
background: var(--xh-_image-viewer-chrome-bg);
|
|
194
|
+
color: inherit;
|
|
195
|
+
border: none;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* 工具条:页面主题的实体面(亮色白面、暗色深面)+ 1px 描边。面色在看片层的白墨域之外取
|
|
199
|
+
(定位层捕获的页面取值),连接层在它身上打 data-xh-ink-surface:七颗钮与作者放进来的内容
|
|
200
|
+
按这块底自成墨色域,字色、悬停阶梯与焦点环都随面的深浅走,不再钉在浅字上。
|
|
201
|
+
强制色下面被换成 Canvas、与遮罩同色,边界只剩这圈描边 */
|
|
202
|
+
.xh-scope-image-viewer[data-part='toolbar'] {
|
|
203
|
+
--xh-ink-surface: var(--xh-image-viewer-toolbar-bg, var(--xh-_image-viewer-page-surface));
|
|
204
|
+
|
|
205
|
+
inset-block-end: max(var(--xh-space-6), env(safe-area-inset-bottom));
|
|
206
|
+
inset-inline-start: 50%;
|
|
207
|
+
translate: -50% 0;
|
|
208
|
+
display: flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
gap: var(--xh-image-viewer-toolbar-gap, var(--xh-space-1));
|
|
211
|
+
padding: var(--xh-image-viewer-toolbar-padding, var(--xh-space-1_5) var(--xh-space-4));
|
|
212
|
+
border: var(--xh-stroke-thin) solid var(--xh-_image-viewer-page-border);
|
|
213
|
+
border-radius: var(--xh-image-viewer-toolbar-radius-outer, var(--xh-image-viewer-overlay-radius, var(--xh-shape-surface)));
|
|
214
|
+
background: var(--xh-image-viewer-toolbar-bg, var(--xh-_image-viewer-page-surface));
|
|
215
|
+
color: var(--xh-_image-viewer-page-fg);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/* 起点是逻辑属性、平移是物理通道:rtl 下行内分量掉头,工具条与计数才落回中线 */
|
|
219
|
+
.xh-scope-image-viewer[data-part='toolbar']:dir(rtl) {
|
|
220
|
+
translate: 50% 0;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* 工具条里的七颗钮:接 Action Control icon 档 xs(字形 16px),视觉盒放大到 box md(36px),
|
|
224
|
+
底色交给工具条,本体只管命中区与按压。钮是工具条这块面上的墨色域:悬停 / 按下走白底阶梯
|
|
225
|
+
(100 → 200),字取次要字色,都按工具条的底色求值。
|
|
226
|
+
position 交给配方的 relative:粗指针下 44px 命中区 ::after 以钮自身为包含块;
|
|
227
|
+
这里若写 static,七块命中区会一起以工具条为包含块、彼此盖住,触屏上只剩最后一颗可点 */
|
|
228
|
+
.xh-scope-image-viewer[data-part='toolbar'] > [data-part] {
|
|
229
|
+
--xh-action-visual-size: var(--xh-control-box-md);
|
|
230
|
+
--xh-action-min-inline-size: var(--xh-control-box-md);
|
|
231
|
+
--xh-action-bg-rest: transparent;
|
|
232
|
+
--xh-action-bg-hover: var(--xh-bg-subtle);
|
|
233
|
+
--xh-action-bg-pressed: var(--xh-bg-subtle-hover);
|
|
234
|
+
--xh-action-bg-focus-visible: transparent;
|
|
235
|
+
--xh-action-bg-disabled: transparent;
|
|
236
|
+
--xh-action-fg-rest: var(--xh-fg-muted);
|
|
237
|
+
--xh-action-fg-hover: var(--xh-fg-muted);
|
|
238
|
+
--xh-action-fg-pressed: var(--xh-fg-muted);
|
|
239
|
+
--xh-action-fg-focus-visible: var(--xh-fg-muted);
|
|
240
|
+
--xh-action-fg-disabled: var(--xh-fg-disabled);
|
|
241
|
+
--xh-action-border-rest: transparent;
|
|
242
|
+
--xh-action-border-hover: transparent;
|
|
243
|
+
--xh-action-border-pressed: transparent;
|
|
244
|
+
--xh-action-border-focus-visible: transparent;
|
|
245
|
+
--xh-action-border-disabled: transparent;
|
|
246
|
+
--xh-action-radius: var(--xh-image-viewer-toolbar-radius, var(--xh-_action-profile-radius));
|
|
247
|
+
--xh-icon-size: var(--xh-image-viewer-icon-size, var(--xh-_action-profile-glyph-size));
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.xh-scope-image-viewer[data-part='counter'] {
|
|
251
|
+
inset-block-start: max(var(--xh-space-6), env(safe-area-inset-top));
|
|
252
|
+
inset-inline-start: 50%;
|
|
253
|
+
translate: -50% 0;
|
|
254
|
+
padding: var(--xh-image-viewer-counter-padding, var(--xh-space-1) var(--xh-space-3));
|
|
255
|
+
border-radius: var(--xh-image-viewer-counter-radius, var(--xh-image-viewer-overlay-radius, var(--xh-shape-control)));
|
|
256
|
+
font-size: var(--xh-text-secondary-size);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.xh-scope-image-viewer[data-part='counter']:dir(rtl) {
|
|
260
|
+
translate: 50% 0;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* 翻页与关闭钮的尺:看片台上的媒体控制钮与同档控件等高(control-h,md 32px),字形比控件内
|
|
264
|
+
图标低一档(sm / md 16px、lg 20px),不压画面。三颗钮与组件同档 */
|
|
265
|
+
.xh-scope-image-viewer:is([data-part='prev-trigger'], [data-part='next-trigger'], [data-part='close-trigger']) {
|
|
266
|
+
--xh-_image-viewer-nav-size: var(--xh-control-h-md);
|
|
267
|
+
--xh-_image-viewer-nav-glyph: var(--xh-glyph-size-sm);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.xh-scope-image-viewer:is([data-part='prev-trigger'], [data-part='next-trigger'], [data-part='close-trigger'])[data-xh-action-size='sm'] {
|
|
271
|
+
--xh-_image-viewer-nav-size: var(--xh-control-h-sm);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.xh-scope-image-viewer:is([data-part='prev-trigger'], [data-part='next-trigger'], [data-part='close-trigger'])[data-xh-action-size='lg'] {
|
|
275
|
+
--xh-_image-viewer-nav-size: var(--xh-control-h-lg);
|
|
276
|
+
--xh-_image-viewer-nav-glyph: var(--xh-glyph-size-md);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/* 两颗翻页钮:浮在图上的单图标圆钮,接 Action Control floating 档(正方盒取 circle),视觉盒改走上面的尺。
|
|
280
|
+
面桥接到自家深色 chrome:跟的是图上那层半透明深底不是页面底色,所以不取 frosted 缺省面,
|
|
281
|
+
也不取语义档的 --xh-bg-subtle-*;到头时是原生 disabled,压不动的东西不给回应 */
|
|
282
|
+
.xh-scope-image-viewer[data-part='prev-trigger'],
|
|
283
|
+
.xh-scope-image-viewer[data-part='next-trigger'] {
|
|
284
|
+
--xh-action-bg-rest: var(--xh-_image-viewer-chrome-bg);
|
|
285
|
+
--xh-action-bg-hover: var(--xh-_image-viewer-chrome-bg-hover);
|
|
286
|
+
--xh-action-bg-pressed: var(--xh-_image-viewer-chrome-bg-active);
|
|
287
|
+
--xh-action-bg-focus-visible: var(--xh-_image-viewer-chrome-bg);
|
|
288
|
+
--xh-action-bg-disabled: var(--xh-_image-viewer-chrome-bg);
|
|
289
|
+
--xh-action-fg-rest: currentColor;
|
|
290
|
+
--xh-action-fg-hover: currentColor;
|
|
291
|
+
--xh-action-fg-pressed: currentColor;
|
|
292
|
+
--xh-action-fg-focus-visible: currentColor;
|
|
293
|
+
--xh-action-fg-disabled: var(--xh-fg-disabled);
|
|
294
|
+
--xh-action-border-rest: transparent;
|
|
295
|
+
--xh-action-border-hover: transparent;
|
|
296
|
+
--xh-action-border-pressed: transparent;
|
|
297
|
+
--xh-action-border-focus-visible: transparent;
|
|
298
|
+
--xh-action-border-disabled: transparent;
|
|
299
|
+
--xh-action-radius: var(--xh-image-viewer-overlay-radius, var(--xh-_action-profile-radius));
|
|
300
|
+
--xh-action-visual-size: var(--xh-image-viewer-nav-size, var(--xh-_image-viewer-nav-size));
|
|
301
|
+
--xh-action-min-inline-size: var(--xh-image-viewer-nav-size, var(--xh-_image-viewer-nav-size));
|
|
302
|
+
--xh-icon-size: var(--xh-image-viewer-icon-size, var(--xh-_image-viewer-nav-glyph));
|
|
303
|
+
|
|
304
|
+
position: absolute;
|
|
305
|
+
z-index: 1;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.xh-scope-image-viewer[data-part='prev-trigger'] {
|
|
309
|
+
inset-inline-start: max(var(--xh-space-5), env(safe-area-inset-left), env(safe-area-inset-right));
|
|
310
|
+
inset-block-start: 50%;
|
|
311
|
+
translate: 0 -50%;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.xh-scope-image-viewer[data-part='next-trigger'] {
|
|
315
|
+
inset-inline-end: max(var(--xh-space-5), env(safe-area-inset-left), env(safe-area-inset-right));
|
|
316
|
+
inset-block-start: 50%;
|
|
317
|
+
translate: 0 -50%;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/* 右上角的关闭钮:悬浮在媒体上的单图标动作,与翻页钮同走 Action Control floating 档、同一把尺(圆形);
|
|
321
|
+
面与翻页钮同一层深色 chrome,离右上角比翻页钮离边远一档,不与画面边角的内容挤在一起 */
|
|
322
|
+
.xh-scope-image-viewer[data-part='close-trigger'] {
|
|
323
|
+
--xh-action-bg-rest: var(--xh-_image-viewer-chrome-bg);
|
|
324
|
+
--xh-action-bg-hover: var(--xh-image-viewer-close-bg-hover, var(--xh-_image-viewer-chrome-bg-hover));
|
|
325
|
+
--xh-action-bg-pressed: var(--xh-image-viewer-close-bg-active, var(--xh-_image-viewer-chrome-bg-active));
|
|
326
|
+
--xh-action-bg-focus-visible: var(--xh-_image-viewer-chrome-bg);
|
|
327
|
+
--xh-action-bg-disabled: var(--xh-_image-viewer-chrome-bg);
|
|
328
|
+
/* 看图时整块 chrome 盖住页面,叉的颜色随那层继承;使用者要单独换叉的颜色走这支槽 */
|
|
329
|
+
--xh-action-fg-rest: var(--xh-image-viewer-close-fg, currentColor);
|
|
330
|
+
--xh-action-fg-hover: var(--xh-image-viewer-close-fg, currentColor);
|
|
331
|
+
--xh-action-fg-pressed: var(--xh-image-viewer-close-fg, currentColor);
|
|
332
|
+
--xh-action-fg-focus-visible: var(--xh-image-viewer-close-fg, currentColor);
|
|
333
|
+
--xh-action-fg-disabled: var(--xh-fg-disabled);
|
|
334
|
+
--xh-action-border-rest: transparent;
|
|
335
|
+
--xh-action-border-hover: transparent;
|
|
336
|
+
--xh-action-border-pressed: transparent;
|
|
337
|
+
--xh-action-border-focus-visible: transparent;
|
|
338
|
+
--xh-action-border-disabled: transparent;
|
|
339
|
+
--xh-action-radius: var(--xh-image-viewer-close-radius, var(--xh-shape-circle));
|
|
340
|
+
--xh-action-visual-size: var(--xh-image-viewer-close-size, var(--xh-_image-viewer-nav-size));
|
|
341
|
+
--xh-action-min-inline-size: var(--xh-image-viewer-close-size, var(--xh-_image-viewer-nav-size));
|
|
342
|
+
--xh-icon-size: var(--xh-image-viewer-icon-size, var(--xh-_image-viewer-nav-glyph));
|
|
343
|
+
|
|
344
|
+
position: absolute;
|
|
345
|
+
z-index: 1;
|
|
346
|
+
inset-block-start: max(var(--xh-space-8), env(safe-area-inset-top));
|
|
347
|
+
inset-inline-end: max(var(--xh-space-8), env(safe-area-inset-left), env(safe-area-inset-right));
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/* liquid 档:data-material="liquid" 下控制层换成液态面,深色纱那一套只属于 standard 档。
|
|
351
|
+
液态面按下层(使用者的图片、遮罩)写墨色域,前景跟着墨色走,不再钉在浅字上。
|
|
352
|
+
工具条是不贴边的一维栏、计数是一行字的 chip,取 pill;翻页与关闭是媒体控制钮,取 circle */
|
|
353
|
+
:where([data-material='liquid']) .xh-scope-image-viewer[data-part='toolbar'][data-xh-liquid],
|
|
354
|
+
:where([data-material='liquid']) .xh-scope-image-viewer[data-part='counter'][data-xh-liquid] {
|
|
355
|
+
border: var(--xh-stroke-thin) solid var(--xh-material-liquid-border);
|
|
356
|
+
background: var(--xh-image-viewer-chrome-bg, var(--xh-_liquid-bg));
|
|
357
|
+
color: var(--xh-material-liquid-fg);
|
|
358
|
+
box-shadow: var(--xh-_liquid-shadow);
|
|
359
|
+
-webkit-backdrop-filter: var(--xh-material-liquid-backdrop);
|
|
360
|
+
backdrop-filter: var(--xh-material-liquid-backdrop);
|
|
361
|
+
/* 换到深浅不同的图上时色调翻转:底色、字色、细线与投影一起淡变 */
|
|
362
|
+
transition:
|
|
363
|
+
background-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
364
|
+
border-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
365
|
+
color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
366
|
+
box-shadow var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/* 液态工具条自己就是墨色域(按下层写 data-xh-ink):钮不再按页面面色另取墨色,
|
|
370
|
+
撤掉 ink-surface,钮里的墨色随这块液态面的域走 */
|
|
371
|
+
:where([data-material='liquid']) .xh-scope-image-viewer[data-part='toolbar'][data-xh-liquid] {
|
|
372
|
+
--xh-ink-surface: initial;
|
|
373
|
+
|
|
374
|
+
border-radius: var(--xh-image-viewer-toolbar-radius-outer, var(--xh-image-viewer-overlay-radius, var(--xh-shape-pill)));
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
:where([data-material='liquid']) .xh-scope-image-viewer[data-part='counter'][data-xh-liquid] {
|
|
378
|
+
border-radius: var(--xh-image-viewer-counter-radius, var(--xh-image-viewer-overlay-radius, var(--xh-shape-pill)));
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/* 工具条里的钮:悬停 / 按下取墨色淡底阶梯,工具条这块液态面就是它们的墨色域 */
|
|
382
|
+
:where([data-material='liquid']) .xh-scope-image-viewer[data-part='toolbar'][data-xh-liquid] > [data-part] {
|
|
383
|
+
--xh-action-bg-hover: var(--xh-image-viewer-action-bg-hover, var(--xh-bg-subtle));
|
|
384
|
+
--xh-action-bg-pressed: var(--xh-image-viewer-action-bg-active, var(--xh-bg-subtle-hover));
|
|
385
|
+
--xh-action-fg-rest: currentColor;
|
|
386
|
+
--xh-action-fg-hover: currentColor;
|
|
387
|
+
--xh-action-fg-pressed: currentColor;
|
|
388
|
+
--xh-action-fg-focus-visible: currentColor;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
:where([data-material='liquid']) .xh-scope-image-viewer[data-part='prev-trigger'][data-xh-liquid],
|
|
392
|
+
:where([data-material='liquid']) .xh-scope-image-viewer[data-part='next-trigger'][data-xh-liquid],
|
|
393
|
+
:where([data-material='liquid']) .xh-scope-image-viewer[data-part='close-trigger'][data-xh-liquid] {
|
|
394
|
+
--xh-action-bg-rest: var(--xh-image-viewer-chrome-bg, var(--xh-_liquid-bg));
|
|
395
|
+
--xh-action-bg-hover: var(--xh-image-viewer-action-bg-hover, var(--xh-_liquid-bg-hover));
|
|
396
|
+
--xh-action-bg-pressed: var(--xh-image-viewer-action-bg-active, var(--xh-_liquid-bg-pressed));
|
|
397
|
+
--xh-action-bg-focus-visible: var(--xh-image-viewer-chrome-bg, var(--xh-material-liquid-focus-surface));
|
|
398
|
+
--xh-action-bg-disabled: var(--xh-image-viewer-chrome-bg, var(--xh-_liquid-bg));
|
|
399
|
+
--xh-action-fg-rest: var(--xh-material-liquid-fg);
|
|
400
|
+
--xh-action-fg-hover: var(--xh-material-liquid-fg);
|
|
401
|
+
--xh-action-fg-pressed: var(--xh-material-liquid-fg);
|
|
402
|
+
--xh-action-fg-focus-visible: var(--xh-material-liquid-fg);
|
|
403
|
+
--xh-action-border-rest: var(--xh-material-liquid-border);
|
|
404
|
+
--xh-action-border-hover: var(--xh-material-liquid-border);
|
|
405
|
+
--xh-action-border-pressed: var(--xh-material-liquid-border);
|
|
406
|
+
--xh-action-border-focus-visible: var(--xh-material-liquid-border);
|
|
407
|
+
--xh-action-border-disabled: var(--xh-material-liquid-border);
|
|
408
|
+
--xh-action-fg-disabled: var(--xh-fg-disabled);
|
|
409
|
+
--xh-action-shadow-rest: var(--xh-_liquid-shadow);
|
|
410
|
+
--xh-action-shadow-hover: var(--xh-_liquid-shadow);
|
|
411
|
+
--xh-action-shadow-pressed: var(--xh-_liquid-shadow);
|
|
412
|
+
--xh-action-shadow-focus-visible: var(--xh-_liquid-shadow);
|
|
413
|
+
--xh-action-shadow-disabled: var(--xh-_liquid-shadow);
|
|
414
|
+
|
|
415
|
+
color: var(--xh-material-liquid-fg);
|
|
416
|
+
-webkit-backdrop-filter: var(--xh-material-liquid-backdrop);
|
|
417
|
+
backdrop-filter: var(--xh-material-liquid-backdrop);
|
|
418
|
+
transform: var(--xh-_liquid-deform);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/* 叉的前景仍认使用者的那支槽;圆钮取 circle */
|
|
422
|
+
:where([data-material='liquid']) .xh-scope-image-viewer[data-part='close-trigger'][data-xh-liquid] {
|
|
423
|
+
--xh-action-fg-rest: var(--xh-image-viewer-close-fg, var(--xh-material-liquid-fg));
|
|
424
|
+
--xh-action-fg-hover: var(--xh-image-viewer-close-fg, var(--xh-material-liquid-fg));
|
|
425
|
+
--xh-action-fg-pressed: var(--xh-image-viewer-close-fg, var(--xh-material-liquid-fg));
|
|
426
|
+
--xh-action-fg-focus-visible: var(--xh-image-viewer-close-fg, var(--xh-material-liquid-fg));
|
|
427
|
+
--xh-action-bg-hover: var(--xh-image-viewer-close-bg-hover, var(--xh-_liquid-bg-hover));
|
|
428
|
+
--xh-action-bg-pressed: var(--xh-image-viewer-close-bg-active, var(--xh-_liquid-bg-pressed));
|
|
429
|
+
--xh-action-radius: var(--xh-image-viewer-close-radius, var(--xh-shape-circle));
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/* 三颗钮的面是一层深色纱,纱底下是使用者的图片,环色算不出稳定的取值。
|
|
433
|
+
content 把前景钉死在浅字上、三颗钮的前景随它继承,环取 currentColor 即是那支浅字,
|
|
434
|
+
不随图片内容也不随主题翻 */
|
|
435
|
+
.xh-scope-image-viewer[data-part='close-trigger']:focus-visible,
|
|
436
|
+
.xh-scope-image-viewer[data-part='prev-trigger']:focus-visible,
|
|
437
|
+
.xh-scope-image-viewer[data-part='next-trigger']:focus-visible {
|
|
438
|
+
--xh-action-ring-color-focus-visible: currentColor;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.xh-scope-image-viewer[data-part='close-trigger'][hidden] {
|
|
442
|
+
display: none;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/* 没写内容就由皮肤画兜底字形;作者往部件里塞了自己的图形,这几条即不命中 */
|
|
446
|
+
.xh-scope-image-viewer[data-part='zoom-in-trigger']:empty::before {
|
|
447
|
+
content: '';
|
|
448
|
+
display: inline-block;
|
|
449
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
450
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
451
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
452
|
+
background-color: currentColor;
|
|
453
|
+
-webkit-mask: var(--xh-glyph-mark-zoom-in) center / contain no-repeat;
|
|
454
|
+
mask: var(--xh-glyph-mark-zoom-in) center / contain no-repeat;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.xh-scope-image-viewer[data-part='zoom-out-trigger']:empty::before {
|
|
458
|
+
content: '';
|
|
459
|
+
display: inline-block;
|
|
460
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
461
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
462
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
463
|
+
background-color: currentColor;
|
|
464
|
+
-webkit-mask: var(--xh-glyph-mark-zoom-out) center / contain no-repeat;
|
|
465
|
+
mask: var(--xh-glyph-mark-zoom-out) center / contain no-repeat;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.xh-scope-image-viewer[data-part='rotate-left-trigger']:empty::before {
|
|
469
|
+
content: '';
|
|
470
|
+
display: inline-block;
|
|
471
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
472
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
473
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
474
|
+
background-color: currentColor;
|
|
475
|
+
-webkit-mask: var(--xh-glyph-mark-rotate-left) center / contain no-repeat;
|
|
476
|
+
mask: var(--xh-glyph-mark-rotate-left) center / contain no-repeat;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.xh-scope-image-viewer[data-part='rotate-right-trigger']:empty::before {
|
|
480
|
+
content: '';
|
|
481
|
+
display: inline-block;
|
|
482
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
483
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
484
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
485
|
+
background-color: currentColor;
|
|
486
|
+
-webkit-mask: var(--xh-glyph-mark-rotate-right) center / contain no-repeat;
|
|
487
|
+
mask: var(--xh-glyph-mark-rotate-right) center / contain no-repeat;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.xh-scope-image-viewer[data-part='flip-horizontal-trigger']:empty::before {
|
|
491
|
+
content: '';
|
|
492
|
+
display: inline-block;
|
|
493
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
494
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
495
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
496
|
+
background-color: currentColor;
|
|
497
|
+
-webkit-mask: var(--xh-glyph-mark-flip-horizontal) center / contain no-repeat;
|
|
498
|
+
mask: var(--xh-glyph-mark-flip-horizontal) center / contain no-repeat;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.xh-scope-image-viewer[data-part='flip-vertical-trigger']:empty::before {
|
|
502
|
+
content: '';
|
|
503
|
+
display: inline-block;
|
|
504
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
505
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
506
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
507
|
+
background-color: currentColor;
|
|
508
|
+
-webkit-mask: var(--xh-glyph-mark-flip-vertical) center / contain no-repeat;
|
|
509
|
+
mask: var(--xh-glyph-mark-flip-vertical) center / contain no-repeat;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.xh-scope-image-viewer[data-part='prev-trigger']:empty::before {
|
|
513
|
+
content: '';
|
|
514
|
+
display: inline-block;
|
|
515
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
516
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
517
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
518
|
+
background-color: currentColor;
|
|
519
|
+
-webkit-mask: var(--xh-glyph-mark-chevron-left) center / contain no-repeat;
|
|
520
|
+
mask: var(--xh-glyph-mark-chevron-left) center / contain no-repeat;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.xh-scope-image-viewer[data-part='next-trigger']:empty::before {
|
|
524
|
+
content: '';
|
|
525
|
+
display: inline-block;
|
|
526
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
527
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
528
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
529
|
+
background-color: currentColor;
|
|
530
|
+
-webkit-mask: var(--xh-glyph-mark-chevron-right) center / contain no-repeat;
|
|
531
|
+
mask: var(--xh-glyph-mark-chevron-right) center / contain no-repeat;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.xh-scope-image-viewer[data-part='close-trigger']:empty::before {
|
|
535
|
+
content: '';
|
|
536
|
+
display: inline-block;
|
|
537
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
538
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
539
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
540
|
+
background-color: currentColor;
|
|
541
|
+
-webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
542
|
+
mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
|
|
546
|
+
写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
|
|
547
|
+
.xh-scope-image-viewer[data-part='positioner'][hidden],
|
|
548
|
+
.xh-scope-image-viewer[data-part='viewport'][hidden],
|
|
549
|
+
.xh-scope-image-viewer[data-part='toolbar'][hidden],
|
|
550
|
+
.xh-scope-image-viewer[data-part='prev-trigger'][hidden],
|
|
551
|
+
.xh-scope-image-viewer[data-part='next-trigger'][hidden] {
|
|
552
|
+
display: none;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
@media print {
|
|
556
|
+
/* 打印:定位层与遮罩是交互期才存在的东西,落到纸上只会盖住底下的正文。
|
|
557
|
+
收起写在这份皮肤里而不是 reset:reset 层排在组件层之前,组件层里任何一条 display 都压得住它。 */
|
|
558
|
+
.xh-scope-image-viewer[data-part='backdrop'],
|
|
559
|
+
.xh-scope-image-viewer[data-part='positioner'] {
|
|
560
|
+
display: none;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
@media (forced-colors: active) {
|
|
565
|
+
/* 兜底字形是 mask 挖出来的一块底色,这一档里底色被系统换成 Canvas,字形跟着消失。
|
|
566
|
+
字形退出强制换色、直接写系统色(不能取 currentColor:退出强制换色的伪元素读到的是被系统换掉之前的作者色):
|
|
567
|
+
按钮面上取 ButtonText,悬停与按下时家族把按钮涂成 Highlight、字形换 HighlightText;
|
|
568
|
+
落在 Canvas 面上的取 CanvasText;
|
|
569
|
+
禁用取 GrayText */
|
|
570
|
+
.xh-scope-image-viewer[data-part='viewport'][data-error]::after {
|
|
571
|
+
forced-color-adjust: none;
|
|
572
|
+
background-color: CanvasText;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.xh-scope-image-viewer:is([data-part='zoom-in-trigger'], [data-part='zoom-out-trigger'], [data-part='rotate-left-trigger'], [data-part='rotate-right-trigger'], [data-part='flip-horizontal-trigger'], [data-part='flip-vertical-trigger'], [data-part='prev-trigger'], [data-part='next-trigger'], [data-part='close-trigger']):empty::before {
|
|
576
|
+
forced-color-adjust: none;
|
|
577
|
+
background-color: ButtonText;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
.xh-scope-image-viewer:is([data-part='zoom-in-trigger'], [data-part='zoom-out-trigger'], [data-part='rotate-left-trigger'], [data-part='rotate-right-trigger'], [data-part='flip-horizontal-trigger'], [data-part='flip-vertical-trigger'], [data-part='prev-trigger'], [data-part='next-trigger'], [data-part='close-trigger']):not([data-disabled]):not([data-loading]):is(:hover, :active, [data-pressed]):empty::before {
|
|
581
|
+
background-color: HighlightText;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.xh-scope-image-viewer:is([data-part='zoom-in-trigger'], [data-part='zoom-out-trigger'], [data-part='rotate-left-trigger'], [data-part='rotate-right-trigger'], [data-part='flip-horizontal-trigger'], [data-part='flip-vertical-trigger'], [data-part='prev-trigger'], [data-part='next-trigger'], [data-part='close-trigger'])[data-disabled]:empty::before {
|
|
585
|
+
background-color: GrayText;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|