@xihan-ui/styles 1.0.0-alpha.2 → 1.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 +2177 -0
- package/README.md +1 -1
- package/css/accordion.css +80 -6
- package/css/alert.css +43 -14
- package/css/anchor.css +8 -8
- package/css/avatar-group.css +7 -3
- package/css/avatar.css +9 -3
- package/css/back-top.css +22 -1
- package/css/badge.css +104 -32
- package/css/breadcrumb.css +25 -5
- package/css/button-group.css +18 -13
- package/css/button.css +48 -11
- package/css/calendar.css +150 -7
- package/css/card.css +20 -11
- package/css/carousel.css +36 -5
- package/css/cascader.css +211 -124
- package/css/checkbox-group.css +72 -22
- package/css/checkbox.css +70 -13
- package/css/clipboard.css +2 -1
- package/css/code-block.css +12 -7
- package/css/collapsible.css +49 -3
- package/css/color-picker.css +132 -46
- package/css/combobox.css +132 -60
- package/css/composer.css +5 -3
- package/css/context-menu.css +113 -74
- package/css/date-field.css +93 -16
- package/css/date-picker.css +293 -72
- package/css/descriptions.css +11 -5
- package/css/dialog.css +47 -14
- package/css/download-trigger.css +76 -0
- package/css/drawer.css +57 -16
- package/css/dynamic-input.css +75 -17
- package/css/editable.css +12 -10
- package/css/ellipsis.css +7 -1
- package/css/empty-state.css +22 -12
- package/css/field.css +16 -6
- package/css/fieldset.css +69 -0
- package/css/file-upload.css +46 -8
- package/css/flex.css +13 -7
- package/css/float-button.css +23 -1
- package/css/floating-panel.css +316 -0
- package/css/form.css +4 -4
- package/css/grid.css +11 -5
- package/css/heatmap.css +411 -0
- package/css/highlight.css +2 -2
- package/css/hotkeys.css +90 -0
- package/css/hover-card.css +43 -45
- package/css/image-cropper.css +233 -0
- package/css/image-viewer.css +155 -17
- package/css/image.css +2 -2
- package/css/infinite-scroll.css +1 -1
- package/css/json-viewer.css +274 -0
- package/css/layout.css +19 -15
- package/css/list.css +22 -13
- package/css/listbox.css +24 -6
- package/css/loading-bar.css +12 -5
- package/css/log.css +7 -3
- package/css/marquee.css +9 -0
- package/css/masonry.css +63 -0
- package/css/mention.css +100 -36
- package/css/menu.css +127 -50
- package/css/menubar.css +155 -61
- package/css/navigation-menu.css +56 -31
- package/css/notification.css +377 -0
- package/css/number-animation.css +3 -3
- package/css/number-field.css +182 -19
- package/css/overlay-arrow.css +51 -0
- package/css/page-header.css +12 -5
- package/css/pagination.css +171 -14
- package/css/password-input.css +356 -0
- package/css/pin-input.css +15 -12
- package/css/popconfirm.css +55 -12
- package/css/popover.css +73 -45
- package/css/popselect.css +207 -57
- package/css/progress.css +54 -8
- package/css/qr-code.css +1 -1
- package/css/radio-group.css +27 -10
- package/css/rating.css +4 -4
- package/css/reset.css +17 -0
- package/css/result.css +21 -11
- package/css/scroll-area.css +61 -89
- package/css/scrollbar.css +170 -0
- package/css/segmented.css +215 -0
- package/css/select.css +298 -131
- package/css/separator.css +2 -2
- package/css/side-nav.css +127 -24
- package/css/signature-pad.css +144 -0
- package/css/skeleton.css +7 -1
- package/css/slider.css +14 -12
- package/css/space.css +117 -0
- package/css/spinner.css +22 -10
- package/css/statistic.css +9 -9
- package/css/steps.css +29 -12
- package/css/switch.css +57 -8
- package/css/table.css +146 -44
- package/css/tabs.css +13 -5
- package/css/tag.css +179 -0
- package/css/tags-input.css +80 -42
- package/css/text-field.css +151 -38
- package/css/thread.css +11 -3
- package/css/time-field.css +99 -18
- package/css/time-picker.css +261 -71
- package/css/timeline.css +15 -15
- package/css/timer.css +119 -0
- package/css/toast.css +129 -55
- package/css/toggle-group.css +30 -4
- package/css/toggle.css +12 -6
- package/css/tone.css +57 -22
- package/css/toolbar.css +1 -1
- package/css/tooltip.css +40 -31
- package/css/tour.css +112 -61
- package/css/transfer.css +98 -21
- package/css/tree-select.css +215 -89
- package/css/tree.css +131 -5
- package/css/typography.css +5 -5
- package/css/undefined.css +12 -1
- package/css/virtualizer.css +3 -1
- package/css/watermark.css +1 -2
- package/index.css +18 -1
- package/index.unlayered.css +10356 -3255
- package/package.json +20 -4
- package/css/toaster.css +0 -74
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
@layer xihan.components {
|
|
2
|
+
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
3
|
+
[data-scope='image-cropper'] {
|
|
4
|
+
--xh-image-cropper-skin: 1;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* 定位分工:裁切框在视口里的 left / top / width / height,以及图片与裁切框的
|
|
8
|
+
transform,由连接层每帧写进内联样式——那四个数是图片像素换算出来的百分比,
|
|
9
|
+
只有连接层算得出来。这份皮肤一个都不碰,写了不但是死声明,还会跟内联值抢位置。
|
|
10
|
+
|
|
11
|
+
私有槽两个,都挂在 root 上靠继承发下去:
|
|
12
|
+
handle-size 是把手的边长,zoom 是当前缩放倍率——裁切框整体被 scale 放大,
|
|
13
|
+
把手与描边要按倍率反向缩回去,否则放到 3 倍时把手也变成三倍大、描边变成三像素粗。 */
|
|
14
|
+
[data-scope='image-cropper'][data-part='root'] {
|
|
15
|
+
--xh-_image-cropper-handle-size: var(--xh-image-cropper-handle-size, var(--xh-control-indicator-size));
|
|
16
|
+
--xh-_image-cropper-zoom: 1;
|
|
17
|
+
|
|
18
|
+
position: relative;
|
|
19
|
+
display: block;
|
|
20
|
+
inline-size: var(--xh-image-cropper-w, 100%);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* 量坐标的那个盒子。里面装的是图片像素坐标,不是文字:裁切框与把手的落点一律写物理属性,
|
|
24
|
+
不依赖这里的文字方向。overflow 收口:放大后的图片与遮罩都靠它裁掉。 */
|
|
25
|
+
[data-scope='image-cropper'][data-part='viewport'] {
|
|
26
|
+
position: relative;
|
|
27
|
+
display: block;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
border-radius: var(--xh-image-cropper-radius, var(--xh-shape-surface));
|
|
30
|
+
background: var(--xh-image-cropper-bg, var(--xh-bg-muted));
|
|
31
|
+
user-select: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* 图片铺满视口、高度自适应:视口的高度因此由图片撑出来,
|
|
35
|
+
裁切框的百分比坐标才与图片的像素一一对应。 */
|
|
36
|
+
[data-scope='image-cropper'][data-part='image'] {
|
|
37
|
+
display: block;
|
|
38
|
+
inline-size: 100%;
|
|
39
|
+
block-size: auto;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* 裁切框。遮罩用一圈超大的实心投影把框外压暗——不必再摆四块遮罩节点,
|
|
43
|
+
圆形裁切时投影也自动跟着圆角走。描边按倍率缩回去,放大时仍是一根细线。 */
|
|
44
|
+
[data-scope='image-cropper'][data-part='crop-area'] {
|
|
45
|
+
position: absolute;
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
border-style: solid;
|
|
48
|
+
border-width: calc(var(--xh-stroke-thin) / var(--xh-_image-cropper-zoom));
|
|
49
|
+
border-color: var(--xh-image-cropper-crop-border, var(--xh-bg-surface));
|
|
50
|
+
box-shadow: 0 0 0 9999px var(--xh-image-cropper-mask, var(--xh-bg-overlay));
|
|
51
|
+
cursor: move;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* 圆形裁切的这一档只能写 50%:shape 那四档给的是固定长度,
|
|
55
|
+
裁切框的宽高由数据决定、两边通常不等长,固定长度画出来是胶囊不是椭圆。 */
|
|
56
|
+
[data-scope='image-cropper'][data-part='crop-area'][data-shape='round'] {
|
|
57
|
+
border-radius: 50%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
[data-scope='image-cropper'][data-part='crop-area'][data-dragging] {
|
|
61
|
+
cursor: grabbing;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
[data-scope='image-cropper'][data-part='crop-area'][data-readonly] {
|
|
65
|
+
cursor: default;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
[data-scope='image-cropper'][data-part='crop-area'][data-disabled] {
|
|
69
|
+
cursor: not-allowed;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* 环往内收:裁切框长在视口里,视口那层 overflow: hidden 会把画在外沿的环裁掉 */
|
|
73
|
+
[data-scope='image-cropper'][data-part='crop-area']:focus-visible {
|
|
74
|
+
outline: var(--xh-ring-width) solid var(--xh-ring-focus);
|
|
75
|
+
outline-offset: calc(-1 * var(--xh-ring-width));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* 三分构图参考线:两条竖线、两条横线,落点写死在三分处,不占节点、不吃指针。
|
|
79
|
+
停靠点逐条写全而不用 repeating-:重复单元从 0 起算会在框的两条边缘上各多画一根,
|
|
80
|
+
那两根与裁切框的描边叠在一起,看着像描边加粗了一倍。
|
|
81
|
+
线宽跟着裁切框的倍率缩回去,与描边同一口径。
|
|
82
|
+
圆形裁切时参考线没有意义,收起来。 */
|
|
83
|
+
[data-scope='image-cropper'][data-part='grid'] {
|
|
84
|
+
--xh-_image-cropper-grid-w: calc(var(--xh-stroke-thin) / var(--xh-_image-cropper-zoom));
|
|
85
|
+
|
|
86
|
+
position: absolute;
|
|
87
|
+
inset: 0;
|
|
88
|
+
background-image:
|
|
89
|
+
linear-gradient(
|
|
90
|
+
to right,
|
|
91
|
+
transparent 0 33.3333%,
|
|
92
|
+
var(--xh-image-cropper-grid-line, var(--xh-border-subtle)) 33.3333% calc(33.3333% + var(--xh-_image-cropper-grid-w)),
|
|
93
|
+
transparent calc(33.3333% + var(--xh-_image-cropper-grid-w)) 66.6667%,
|
|
94
|
+
var(--xh-image-cropper-grid-line, var(--xh-border-subtle)) 66.6667% calc(66.6667% + var(--xh-_image-cropper-grid-w)),
|
|
95
|
+
transparent calc(66.6667% + var(--xh-_image-cropper-grid-w)) 100%
|
|
96
|
+
),
|
|
97
|
+
linear-gradient(
|
|
98
|
+
to bottom,
|
|
99
|
+
transparent 0 33.3333%,
|
|
100
|
+
var(--xh-image-cropper-grid-line, var(--xh-border-subtle)) 33.3333% calc(33.3333% + var(--xh-_image-cropper-grid-w)),
|
|
101
|
+
transparent calc(33.3333% + var(--xh-_image-cropper-grid-w)) 66.6667%,
|
|
102
|
+
var(--xh-image-cropper-grid-line, var(--xh-border-subtle)) 66.6667% calc(66.6667% + var(--xh-_image-cropper-grid-w)),
|
|
103
|
+
transparent calc(66.6667% + var(--xh-_image-cropper-grid-w)) 100%
|
|
104
|
+
);
|
|
105
|
+
pointer-events: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
[data-scope='image-cropper'][data-part='grid'][data-shape='round'] {
|
|
109
|
+
background-image: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* 把手钉在裁切框的角与边上。落点写物理 left / top:裁切框的坐标是图片像素,
|
|
113
|
+
连接层写进内联样式的也是物理 left / top,把手跟着走才不会与框错开一侧。
|
|
114
|
+
translate 把方块的中心挪到点上;scale 按倍率缩回去,缩放时把手看着大小不变。 */
|
|
115
|
+
[data-scope='image-cropper'][data-part='crop-handle'] {
|
|
116
|
+
position: absolute;
|
|
117
|
+
display: block;
|
|
118
|
+
box-sizing: border-box;
|
|
119
|
+
border-style: solid;
|
|
120
|
+
border-width: calc(var(--xh-stroke-thin) / var(--xh-_image-cropper-zoom));
|
|
121
|
+
border-color: var(--xh-image-cropper-handle-border, var(--xh-border-strong));
|
|
122
|
+
border-radius: var(--xh-image-cropper-handle-radius, var(--xh-shape-inset));
|
|
123
|
+
background: var(--xh-image-cropper-handle-bg, var(--xh-bg-surface));
|
|
124
|
+
inline-size: var(--xh-_image-cropper-handle-size);
|
|
125
|
+
block-size: var(--xh-_image-cropper-handle-size);
|
|
126
|
+
translate: -50% -50%;
|
|
127
|
+
scale: calc(1 / var(--xh-_image-cropper-zoom));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* 看得见的方块比手指小:另铺一层不可见的命中区,把它撑到最小可点尺寸。
|
|
131
|
+
inset 取负值即向四面外扩,方块本身更大时这个值转正、命中区仍是方块那么大。 */
|
|
132
|
+
[data-scope='image-cropper'][data-part='crop-handle']::before {
|
|
133
|
+
position: absolute;
|
|
134
|
+
inset: calc((var(--xh-_image-cropper-handle-size) - var(--xh-control-action-size)) / 2);
|
|
135
|
+
content: '';
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* 与裁切框同一口径:把手也在视口的 overflow: hidden 里,环画在外沿会被裁掉 */
|
|
139
|
+
[data-scope='image-cropper'][data-part='crop-handle']:focus-visible {
|
|
140
|
+
outline: var(--xh-ring-width) solid var(--xh-ring-focus);
|
|
141
|
+
outline-offset: calc(-1 * var(--xh-ring-width));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
[data-scope='image-cropper'][data-part='crop-handle'][data-resizing] {
|
|
145
|
+
background: var(--xh-image-cropper-handle-bg-resizing, var(--xh-bg-brand));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* —— 八个方位:落点 + 光标 —— */
|
|
149
|
+
[data-scope='image-cropper'][data-part='crop-handle'][data-position='nw'] {
|
|
150
|
+
top: 0;
|
|
151
|
+
/* stylelint-disable-next-line property-disallowed-list -- 裁切框的坐标是图片像素,落点跟着物理方向走 */
|
|
152
|
+
left: 0;
|
|
153
|
+
cursor: nwse-resize;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
[data-scope='image-cropper'][data-part='crop-handle'][data-position='n'] {
|
|
157
|
+
top: 0;
|
|
158
|
+
/* stylelint-disable-next-line property-disallowed-list -- 同上 */
|
|
159
|
+
left: 50%;
|
|
160
|
+
cursor: ns-resize;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
[data-scope='image-cropper'][data-part='crop-handle'][data-position='ne'] {
|
|
164
|
+
top: 0;
|
|
165
|
+
/* stylelint-disable-next-line property-disallowed-list -- 同上 */
|
|
166
|
+
left: 100%;
|
|
167
|
+
cursor: nesw-resize;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
[data-scope='image-cropper'][data-part='crop-handle'][data-position='e'] {
|
|
171
|
+
top: 50%;
|
|
172
|
+
/* stylelint-disable-next-line property-disallowed-list -- 同上 */
|
|
173
|
+
left: 100%;
|
|
174
|
+
cursor: ew-resize;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
[data-scope='image-cropper'][data-part='crop-handle'][data-position='se'] {
|
|
178
|
+
top: 100%;
|
|
179
|
+
/* stylelint-disable-next-line property-disallowed-list -- 同上 */
|
|
180
|
+
left: 100%;
|
|
181
|
+
cursor: nwse-resize;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
[data-scope='image-cropper'][data-part='crop-handle'][data-position='s'] {
|
|
185
|
+
top: 100%;
|
|
186
|
+
/* stylelint-disable-next-line property-disallowed-list -- 同上 */
|
|
187
|
+
left: 50%;
|
|
188
|
+
cursor: ns-resize;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
[data-scope='image-cropper'][data-part='crop-handle'][data-position='sw'] {
|
|
192
|
+
top: 100%;
|
|
193
|
+
/* stylelint-disable-next-line property-disallowed-list -- 同上 */
|
|
194
|
+
left: 0;
|
|
195
|
+
cursor: nesw-resize;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
[data-scope='image-cropper'][data-part='crop-handle'][data-position='w'] {
|
|
199
|
+
top: 50%;
|
|
200
|
+
/* stylelint-disable-next-line property-disallowed-list -- 同上 */
|
|
201
|
+
left: 0;
|
|
202
|
+
cursor: ew-resize;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* 只读与禁用的光标排在八个方位之后:那八条每条都写了 cursor,特异性又完全相同,
|
|
206
|
+
排在前面会被逐条盖掉,整条规则等于没写。 */
|
|
207
|
+
[data-scope='image-cropper'][data-part='crop-handle'][data-readonly] {
|
|
208
|
+
cursor: default;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
[data-scope='image-cropper'][data-part='crop-handle'][data-disabled] {
|
|
212
|
+
cursor: not-allowed;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* 禁用的整体压暗只做一次,落在最外层:视口、裁切框、把手各自再叠一层会越叠越黑。
|
|
216
|
+
这里只用 opacity、不换前景色:框里是图像,没有文字可换。 */
|
|
217
|
+
[data-scope='image-cropper'][data-part='root'][data-disabled] {
|
|
218
|
+
cursor: not-allowed;
|
|
219
|
+
opacity: var(--xh-state-disabled-opacity);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* hidden-input 是 type=hidden 的原生输入,浏览器本就不渲染它,
|
|
223
|
+
这里一条声明都不给:给了 display / 尺寸反而会把它拽回布局里撑出一块空白。 */
|
|
224
|
+
|
|
225
|
+
/* display 会盖掉 UA 的 [hidden]{display:none},凡是被赋了 display 的角色节点都要显式让位。
|
|
226
|
+
这条必须排在全部 display 声明之后。 */
|
|
227
|
+
[data-scope='image-cropper'][data-part='root'][hidden],
|
|
228
|
+
[data-scope='image-cropper'][data-part='viewport'][hidden],
|
|
229
|
+
[data-scope='image-cropper'][data-part='image'][hidden],
|
|
230
|
+
[data-scope='image-cropper'][data-part='crop-handle'][hidden] {
|
|
231
|
+
display: none;
|
|
232
|
+
}
|
|
233
|
+
}
|
package/css/image-viewer.css
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
[data-scope='image-viewer'][data-part='backdrop'] {
|
|
32
32
|
position: fixed;
|
|
33
33
|
inset: 0;
|
|
34
|
-
z-index: var(--xh-layer-modal);
|
|
34
|
+
z-index: var(--xh-image-viewer-backdrop-layer, var(--xh-layer-modal));
|
|
35
35
|
/* 看片要压住页面底色,遮罩比普通对话框更深 */
|
|
36
36
|
background: var(--xh-image-viewer-backdrop-bg, color-mix(in oklab, var(--xh-color-neutral-950) 78%, transparent));
|
|
37
37
|
}
|
|
@@ -47,13 +47,20 @@
|
|
|
47
47
|
[data-scope='image-viewer'][data-part='positioner'] {
|
|
48
48
|
position: fixed;
|
|
49
49
|
inset: 0;
|
|
50
|
-
z-index: var(--xh-layer-modal);
|
|
50
|
+
z-index: var(--xh-image-viewer-layer, var(--xh-layer-modal));
|
|
51
51
|
display: flex;
|
|
52
52
|
align-items: center;
|
|
53
53
|
justify-content: center;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
[data-scope='image-viewer'][data-part='content'] {
|
|
57
|
+
/* 组件内那几档层号只在自己人之间排序:建一个层叠上下文把它们关起来,
|
|
58
|
+
既不让页面上的层号插进来,也不让它们漏出去压住别人 */
|
|
59
|
+
isolation: isolate;
|
|
60
|
+
|
|
61
|
+
/* 作者塞进指示符槽的图标跟着字号走,与皮肤画的兜底字形同一把尺 */
|
|
62
|
+
--xh-icon-size: var(--xh-image-viewer-icon-size, var(--xh-glyph-size-text));
|
|
63
|
+
|
|
57
64
|
position: relative;
|
|
58
65
|
inline-size: 100%;
|
|
59
66
|
block-size: 100%;
|
|
@@ -94,7 +101,7 @@
|
|
|
94
101
|
max-block-size: 85%;
|
|
95
102
|
user-select: none;
|
|
96
103
|
/* 变换是内联 style 写的,只给缩放旋转一点缓动;拖拽平移要跟手,不缓 */
|
|
97
|
-
transition: transform var(--xh-duration-
|
|
104
|
+
transition: transform var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
98
105
|
}
|
|
99
106
|
|
|
100
107
|
[data-scope='image-viewer'][data-part='image'][data-panning] {
|
|
@@ -105,14 +112,13 @@
|
|
|
105
112
|
[data-scope='image-viewer'][data-part='toolbar'],
|
|
106
113
|
[data-scope='image-viewer'][data-part='counter'],
|
|
107
114
|
[data-scope='image-viewer'][data-part='prev-trigger'],
|
|
108
|
-
[data-scope='image-viewer'][data-part='next-trigger']
|
|
109
|
-
[data-scope='image-viewer'][data-part='close-trigger'] {
|
|
115
|
+
[data-scope='image-viewer'][data-part='next-trigger'] {
|
|
110
116
|
position: absolute;
|
|
111
117
|
z-index: 1;
|
|
112
118
|
background: var(--xh-image-viewer-chrome-bg, color-mix(in oklab, var(--xh-color-neutral-950) 55%, transparent));
|
|
113
119
|
color: inherit;
|
|
114
120
|
border: none;
|
|
115
|
-
border-radius: var(--xh-shape-pill);
|
|
121
|
+
border-radius: var(--xh-image-viewer-overlay-radius, var(--xh-shape-pill));
|
|
116
122
|
}
|
|
117
123
|
|
|
118
124
|
[data-scope='image-viewer'][data-part='toolbar'] {
|
|
@@ -121,8 +127,8 @@
|
|
|
121
127
|
translate: -50% 0;
|
|
122
128
|
display: flex;
|
|
123
129
|
align-items: center;
|
|
124
|
-
gap: var(--xh-space-1);
|
|
125
|
-
padding: var(--xh-space-1_5) var(--xh-space-3);
|
|
130
|
+
gap: var(--xh-image-viewer-toolbar-gap, var(--xh-space-1));
|
|
131
|
+
padding: var(--xh-image-viewer-toolbar-padding, var(--xh-space-1_5) var(--xh-space-3));
|
|
126
132
|
}
|
|
127
133
|
|
|
128
134
|
/* 工具条里的按钮:底色交给工具条,本体只管命中区 */
|
|
@@ -135,7 +141,7 @@
|
|
|
135
141
|
block-size: var(--xh-control-action-size);
|
|
136
142
|
background: none;
|
|
137
143
|
border: none;
|
|
138
|
-
border-radius: var(--xh-shape-control);
|
|
144
|
+
border-radius: var(--xh-image-viewer-toolbar-radius, var(--xh-shape-control));
|
|
139
145
|
color: inherit;
|
|
140
146
|
font-size: var(--xh-glyph-size-sm);
|
|
141
147
|
cursor: pointer;
|
|
@@ -145,13 +151,12 @@
|
|
|
145
151
|
inset-block-start: var(--xh-space-6);
|
|
146
152
|
inset-inline-start: 50%;
|
|
147
153
|
translate: -50% 0;
|
|
148
|
-
padding: var(--xh-space-1) var(--xh-space-3);
|
|
149
|
-
font-size: var(--xh-
|
|
154
|
+
padding: var(--xh-image-viewer-counter-padding, var(--xh-space-1) var(--xh-space-3));
|
|
155
|
+
font-size: var(--xh-text-secondary-size);
|
|
150
156
|
}
|
|
151
157
|
|
|
152
158
|
[data-scope='image-viewer'][data-part='prev-trigger'],
|
|
153
|
-
[data-scope='image-viewer'][data-part='next-trigger']
|
|
154
|
-
[data-scope='image-viewer'][data-part='close-trigger'] {
|
|
159
|
+
[data-scope='image-viewer'][data-part='next-trigger'] {
|
|
155
160
|
display: inline-flex;
|
|
156
161
|
align-items: center;
|
|
157
162
|
justify-content: center;
|
|
@@ -173,9 +178,39 @@
|
|
|
173
178
|
translate: 0 -50%;
|
|
174
179
|
}
|
|
175
180
|
|
|
181
|
+
/* 右上角的关闭钮:与翻页钮同底同高,但圆角走控件档,按下有缩放 */
|
|
176
182
|
[data-scope='image-viewer'][data-part='close-trigger'] {
|
|
183
|
+
position: absolute;
|
|
184
|
+
z-index: 1;
|
|
177
185
|
inset-block-start: var(--xh-space-6);
|
|
178
186
|
inset-inline-end: var(--xh-space-6);
|
|
187
|
+
display: inline-flex;
|
|
188
|
+
align-items: center;
|
|
189
|
+
justify-content: center;
|
|
190
|
+
inline-size: var(--xh-image-viewer-close-size, var(--xh-control-h-lg));
|
|
191
|
+
block-size: var(--xh-image-viewer-close-size, var(--xh-control-h-lg));
|
|
192
|
+
border: none;
|
|
193
|
+
border-radius: var(--xh-image-viewer-close-radius, var(--xh-shape-control));
|
|
194
|
+
background: var(--xh-image-viewer-chrome-bg, color-mix(in oklab, var(--xh-color-neutral-950) 55%, transparent));
|
|
195
|
+
color: inherit;
|
|
196
|
+
font-size: var(--xh-glyph-size-md);
|
|
197
|
+
cursor: pointer;
|
|
198
|
+
transition:
|
|
199
|
+
background var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
200
|
+
scale var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
[data-scope='image-viewer'][data-part='close-trigger'][hidden] {
|
|
204
|
+
display: none;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
[data-scope='image-viewer'][data-part='close-trigger']:hover:not(:disabled) {
|
|
208
|
+
background: var(--xh-image-viewer-close-bg-hover, color-mix(in oklab, var(--xh-color-neutral-950) 70%, transparent));
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
[data-scope='image-viewer'][data-part='close-trigger']:active {
|
|
212
|
+
background: var(--xh-image-viewer-close-bg-active, color-mix(in oklab, var(--xh-color-neutral-950) 80%, transparent));
|
|
213
|
+
scale: var(--xh-motion-scale-press);
|
|
179
214
|
}
|
|
180
215
|
|
|
181
216
|
[data-scope='image-viewer'] button[data-part]:focus-visible {
|
|
@@ -188,9 +223,112 @@
|
|
|
188
223
|
cursor: not-allowed;
|
|
189
224
|
}
|
|
190
225
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
226
|
+
/* 没写内容就由皮肤画兜底字形;作者往部件里塞了自己的图形,这几条即不命中 */
|
|
227
|
+
[data-scope='image-viewer'][data-part='zoom-in-trigger']:empty::before {
|
|
228
|
+
content: '';
|
|
229
|
+
display: inline-block;
|
|
230
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
231
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
232
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
233
|
+
background-color: currentColor;
|
|
234
|
+
-webkit-mask: var(--xh-glyph-mark-zoom-in) center / contain no-repeat;
|
|
235
|
+
mask: var(--xh-glyph-mark-zoom-in) center / contain no-repeat;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
[data-scope='image-viewer'][data-part='zoom-out-trigger']:empty::before {
|
|
239
|
+
content: '';
|
|
240
|
+
display: inline-block;
|
|
241
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
242
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
243
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
244
|
+
background-color: currentColor;
|
|
245
|
+
-webkit-mask: var(--xh-glyph-mark-zoom-out) center / contain no-repeat;
|
|
246
|
+
mask: var(--xh-glyph-mark-zoom-out) center / contain no-repeat;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
[data-scope='image-viewer'][data-part='rotate-left-trigger']:empty::before {
|
|
250
|
+
content: '';
|
|
251
|
+
display: inline-block;
|
|
252
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
253
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
254
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
255
|
+
background-color: currentColor;
|
|
256
|
+
-webkit-mask: var(--xh-glyph-mark-rotate-left) center / contain no-repeat;
|
|
257
|
+
mask: var(--xh-glyph-mark-rotate-left) center / contain no-repeat;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
[data-scope='image-viewer'][data-part='rotate-right-trigger']:empty::before {
|
|
261
|
+
content: '';
|
|
262
|
+
display: inline-block;
|
|
263
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
264
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
265
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
266
|
+
background-color: currentColor;
|
|
267
|
+
-webkit-mask: var(--xh-glyph-mark-rotate-right) center / contain no-repeat;
|
|
268
|
+
mask: var(--xh-glyph-mark-rotate-right) center / contain no-repeat;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
[data-scope='image-viewer'][data-part='flip-horizontal-trigger']:empty::before {
|
|
272
|
+
content: '';
|
|
273
|
+
display: inline-block;
|
|
274
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
275
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
276
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
277
|
+
background-color: currentColor;
|
|
278
|
+
-webkit-mask: var(--xh-glyph-mark-flip-horizontal) center / contain no-repeat;
|
|
279
|
+
mask: var(--xh-glyph-mark-flip-horizontal) center / contain no-repeat;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
[data-scope='image-viewer'][data-part='flip-vertical-trigger']:empty::before {
|
|
283
|
+
content: '';
|
|
284
|
+
display: inline-block;
|
|
285
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
286
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
287
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
288
|
+
background-color: currentColor;
|
|
289
|
+
-webkit-mask: var(--xh-glyph-mark-flip-vertical) center / contain no-repeat;
|
|
290
|
+
mask: var(--xh-glyph-mark-flip-vertical) center / contain no-repeat;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
[data-scope='image-viewer'][data-part='prev-trigger']:empty::before {
|
|
294
|
+
content: '';
|
|
295
|
+
display: inline-block;
|
|
296
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
297
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
298
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
299
|
+
background-color: currentColor;
|
|
300
|
+
-webkit-mask: var(--xh-glyph-mark-chevron-left) center / contain no-repeat;
|
|
301
|
+
mask: var(--xh-glyph-mark-chevron-left) center / contain no-repeat;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
[data-scope='image-viewer'][data-part='next-trigger']:empty::before {
|
|
305
|
+
content: '';
|
|
306
|
+
display: inline-block;
|
|
307
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
308
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
309
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
310
|
+
background-color: currentColor;
|
|
311
|
+
-webkit-mask: var(--xh-glyph-mark-chevron-right) center / contain no-repeat;
|
|
312
|
+
mask: var(--xh-glyph-mark-chevron-right) center / contain no-repeat;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
[data-scope='image-viewer'][data-part='close-trigger']:empty::before {
|
|
316
|
+
content: '';
|
|
317
|
+
display: inline-block;
|
|
318
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
319
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
320
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
321
|
+
background-color: currentColor;
|
|
322
|
+
-webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
323
|
+
mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
|
|
327
|
+
写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
|
|
328
|
+
[data-scope='image-viewer'][data-part='positioner'][hidden],
|
|
329
|
+
[data-scope='image-viewer'][data-part='viewport'][hidden],
|
|
330
|
+
[data-scope='image-viewer'][data-part='toolbar'][hidden],
|
|
331
|
+
[data-scope='image-viewer'][data-part='next-trigger'][hidden] {
|
|
332
|
+
display: none;
|
|
195
333
|
}
|
|
196
334
|
}
|
package/css/image.css
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
inline-size: var(--xh-image-w, 100%);
|
|
14
14
|
block-size: var(--xh-image-h, auto);
|
|
15
15
|
aspect-ratio: var(--xh-image-ratio, auto);
|
|
16
|
-
border-radius: var(--xh-image-radius, var(--xh-
|
|
16
|
+
border-radius: var(--xh-image-radius, var(--xh-shape-control));
|
|
17
17
|
background: var(--xh-image-bg, var(--xh-bg-subtle));
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
/* 没给 ratio 时根盒子高度是 auto,回退内容自己撑出一个不塌的高度 */
|
|
39
39
|
min-block-size: var(--xh-image-fallback-min-h, var(--xh-control-h-lg));
|
|
40
40
|
color: var(--xh-image-fallback-fg, var(--xh-fg-muted));
|
|
41
|
-
font-size: var(--xh-image-fallback-font-size, var(--xh-
|
|
41
|
+
font-size: var(--xh-image-fallback-font-size, var(--xh-text-secondary-size));
|
|
42
42
|
line-height: var(--xh-leading-none);
|
|
43
43
|
user-select: none;
|
|
44
44
|
}
|
package/css/infinite-scroll.css
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
* 列表外壳这一层刻意不给盒模型:滚的是页面还是作者自己的 overflow 容器、列表长什么样,
|
|
9
|
-
* 都归作者的布局管,组件只往它身上挂 data-
|
|
9
|
+
* 都归作者的布局管,组件只往它身上挂 data-loading / data-disabled 供作者取用。
|
|
10
10
|
* 一旦声明 display,UA 的 [hidden]{display:none} 就压不住了,故连 display 也不写。
|
|
11
11
|
*
|
|
12
12
|
* 哨兵是纯机制,不是可见元素:给它一条最细的高度让它有个能被观察到的盒子,
|