@xihan-ui/styles 1.0.0-alpha.3 → 1.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.
Files changed (99) hide show
  1. package/CHANGELOG.md +1922 -0
  2. package/README.md +1 -1
  3. package/css/accordion.css +25 -2
  4. package/css/alert.css +13 -9
  5. package/css/anchor.css +1 -1
  6. package/css/avatar-group.css +5 -1
  7. package/css/avatar.css +6 -0
  8. package/css/back-top.css +6 -0
  9. package/css/badge.css +94 -36
  10. package/css/breadcrumb.css +1 -1
  11. package/css/button-group.css +4 -0
  12. package/css/button.css +6 -0
  13. package/css/calendar.css +39 -13
  14. package/css/card.css +15 -6
  15. package/css/cascader.css +29 -23
  16. package/css/checkbox-group.css +38 -10
  17. package/css/checkbox.css +21 -10
  18. package/css/collapsible.css +7 -1
  19. package/css/color-picker.css +22 -2
  20. package/css/combobox.css +18 -7
  21. package/css/context-menu.css +17 -6
  22. package/css/date-field.css +2 -2
  23. package/css/date-picker.css +27 -17
  24. package/css/descriptions.css +9 -3
  25. package/css/dialog.css +7 -1
  26. package/css/drawer.css +15 -5
  27. package/css/dynamic-input.css +7 -0
  28. package/css/ellipsis.css +6 -0
  29. package/css/empty-state.css +16 -6
  30. package/css/field.css +7 -0
  31. package/css/file-upload.css +1 -1
  32. package/css/flex.css +13 -7
  33. package/css/float-button.css +7 -0
  34. package/css/floating-panel.css +6 -0
  35. package/css/grid.css +11 -5
  36. package/css/heatmap.css +3 -2
  37. package/css/highlight.css +1 -1
  38. package/css/hotkeys.css +1 -1
  39. package/css/hover-card.css +3 -0
  40. package/css/image-cropper.css +4 -2
  41. package/css/image-viewer.css +18 -5
  42. package/css/json-viewer.css +34 -1
  43. package/css/layout.css +15 -7
  44. package/css/list.css +14 -5
  45. package/css/listbox.css +4 -2
  46. package/css/loading-bar.css +5 -4
  47. package/css/log.css +6 -2
  48. package/css/masonry.css +5 -5
  49. package/css/mention.css +13 -3
  50. package/css/menu.css +16 -5
  51. package/css/menubar.css +14 -6
  52. package/css/navigation-menu.css +2 -2
  53. package/css/notification.css +377 -0
  54. package/css/number-field.css +9 -3
  55. package/css/page-header.css +7 -0
  56. package/css/pagination.css +158 -1
  57. package/css/password-input.css +4 -4
  58. package/css/pin-input.css +2 -2
  59. package/css/popconfirm.css +9 -2
  60. package/css/popover.css +3 -0
  61. package/css/popselect.css +24 -4
  62. package/css/progress.css +8 -2
  63. package/css/radio-group.css +17 -6
  64. package/css/rating.css +2 -2
  65. package/css/resizable.css +113 -0
  66. package/css/result.css +15 -5
  67. package/css/scrollbar.css +3 -0
  68. package/css/segmented.css +1 -1
  69. package/css/select.css +25 -7
  70. package/css/side-nav.css +16 -5
  71. package/css/slider.css +4 -2
  72. package/css/sortable.css +103 -0
  73. package/css/space.css +6 -6
  74. package/css/steps.css +6 -6
  75. package/css/switch.css +9 -2
  76. package/css/table.css +309 -10
  77. package/css/tabs.css +148 -1
  78. package/css/tag.css +3 -1
  79. package/css/tags-input.css +3 -3
  80. package/css/text-field.css +3 -3
  81. package/css/thread.css +10 -2
  82. package/css/time-field.css +2 -2
  83. package/css/time-picker.css +6 -6
  84. package/css/timeline.css +7 -7
  85. package/css/toast.css +103 -53
  86. package/css/toggle-group.css +30 -4
  87. package/css/toggle.css +6 -0
  88. package/css/tone.css +47 -17
  89. package/css/tooltip.css +7 -1
  90. package/css/tour.css +9 -3
  91. package/css/transfer.css +38 -12
  92. package/css/tree-select.css +30 -5
  93. package/css/tree.css +175 -4
  94. package/css/typography.css +1 -1
  95. package/css/undefined.css +1 -0
  96. package/index.css +3 -1
  97. package/index.unlayered.css +2650 -634
  98. package/package.json +5 -3
  99. package/css/toaster.css +0 -74
@@ -10,6 +10,9 @@
10
10
  引擎没算(尚未落位 / 无引擎 / 贴边归零)时不额外限高 */
11
11
  --xh-_date-picker-available-h: 100vh;
12
12
 
13
+ /* 面板的自绘条浮在内容之上:轨道不上底色,实色轨道会在面板右缘糊出一条竖灰带 */
14
+ --xh-scrollbar-track-bg: transparent;
15
+
13
16
  position: fixed;
14
17
  z-index: var(--xh-date-picker-layer, var(--xh-layer-popover));
15
18
  /* 空壳不吃指针,交互只发生在 content 里 */
@@ -28,8 +31,8 @@
28
31
  --xh-_date-picker-control-h: var(--xh-control-h-md);
29
32
  --xh-_date-picker-control-px: var(--xh-control-px-md);
30
33
  --xh-_date-picker-gap: var(--xh-control-gap-md);
31
- --xh-_date-picker-font-size: var(--xh-text-body-size);
32
- --xh-_date-picker-label-font-size: var(--xh-text-label-size);
34
+ --xh-_date-picker-font-size: var(--xh-control-font-md);
35
+ --xh-_date-picker-label-font-size: var(--xh-control-font-md);
33
36
 
34
37
  /* 形态档只换这三个私有槽:底色与两档描边 */
35
38
  --xh-_date-picker-control-bg: var(--xh-bg-canvas);
@@ -326,6 +329,11 @@
326
329
  border-inline-start: var(--xh-stroke-thin) solid var(--xh-date-picker-panel-divider, var(--xh-border-subtle));
327
330
  }
328
331
 
332
+ /* 快捷选项列与它旁边那张日历之间留出同样的空当,两道分隔线左右对称 */
333
+ [data-scope='date-picker'][data-part='presets'] + [data-scope='date-picker'][data-part='calendar'] {
334
+ padding-inline-start: var(--xh-date-picker-panel-gap, var(--xh-space-3));
335
+ }
336
+
329
337
  [data-scope='date-picker'][data-part='calendar'] {
330
338
  display: flex;
331
339
  flex-direction: column;
@@ -342,13 +350,15 @@
342
350
  [data-scope='date-picker'][data-part='presets'] {
343
351
  display: flex;
344
352
  flex: none;
353
+ /* 这一列的高度由并排的日历给:不写就按内容收,右侧那道分隔线只画到最后一条选项 */
354
+ align-self: stretch;
345
355
  flex-direction: column;
346
- gap: var(--xh-date-picker-presets-gap, var(--xh-space-0_5));
356
+ gap: var(--xh-date-picker-presets-gap, var(--xh-list-option-gap));
347
357
  /* 选项多起来时这一列自己滚,不把整张面板撑高 */
348
- max-block-size: var(--xh-date-picker-presets-h, var(--xh-viewport-h-sm));
349
- padding: var(--xh-space-1);
358
+ max-block-size: var(--xh-date-picker-presets-h, var(--xh-viewport-h-lg));
359
+ padding: var(--xh-date-picker-presets-padding, var(--xh-space-1));
350
360
  overflow-y: auto;
351
- border-inline-end: var(--xh-stroke-thin) solid var(--xh-date-picker-content-border, var(--xh-border-default));
361
+ border-inline-end: var(--xh-stroke-thin) solid var(--xh-date-picker-column-divider, var(--xh-border-subtle));
352
362
  }
353
363
 
354
364
  [data-scope='date-picker'][data-part='presets'][hidden] {
@@ -356,9 +366,9 @@
356
366
  }
357
367
 
358
368
  [data-scope='date-picker'][data-part='preset'] {
359
- padding-block: var(--xh-space-1);
360
- padding-inline: var(--xh-space-3);
361
- border-radius: var(--xh-shape-control);
369
+ padding-block: var(--xh-date-picker-preset-py, var(--xh-space-1));
370
+ padding-inline: var(--xh-date-picker-preset-px, var(--xh-space-3));
371
+ border-radius: var(--xh-date-picker-preset-radius, var(--xh-shape-control));
362
372
  font-size: var(--xh-text-secondary-size);
363
373
  line-height: var(--xh-leading-normal);
364
374
  white-space: nowrap;
@@ -393,12 +403,12 @@
393
403
  [data-scope='date-picker'][data-part='time-column'] {
394
404
  display: flex;
395
405
  flex-direction: column;
396
- gap: var(--xh-date-picker-time-column-gap, var(--xh-space-0_5));
406
+ gap: var(--xh-date-picker-time-column-gap, var(--xh-list-option-gap));
397
407
  /* 几列并排:定高而不是随内容收,否则时列与分列的可选值一多一少就错位 */
398
408
  block-size: var(--xh-date-picker-time-column-h, var(--xh-viewport-h-sm));
399
- padding: var(--xh-space-1);
409
+ padding: var(--xh-date-picker-time-column-padding, var(--xh-space-1));
400
410
  overflow-y: auto;
401
- border-inline-start: var(--xh-stroke-thin) solid var(--xh-date-picker-content-border, var(--xh-border-default));
411
+ border-inline-start: var(--xh-stroke-thin) solid var(--xh-date-picker-column-divider, var(--xh-border-subtle));
402
412
  }
403
413
 
404
414
  [data-scope='date-picker'][data-part='time-column'][hidden] {
@@ -406,9 +416,9 @@
406
416
  }
407
417
 
408
418
  [data-scope='date-picker'][data-part='time-item'] {
409
- padding-block: var(--xh-space-1);
410
- padding-inline: var(--xh-space-3);
411
- border-radius: var(--xh-shape-control);
419
+ padding-block: var(--xh-date-picker-time-item-py, var(--xh-space-1));
420
+ padding-inline: var(--xh-date-picker-time-item-px, var(--xh-space-3));
421
+ border-radius: var(--xh-date-picker-time-item-radius, var(--xh-shape-control));
412
422
  font-size: var(--xh-text-secondary-size);
413
423
  line-height: var(--xh-leading-normal);
414
424
  text-align: center;
@@ -438,9 +448,9 @@
438
448
  align-items: center;
439
449
  justify-content: center;
440
450
  block-size: var(--xh-control-h-sm);
441
- padding-inline: var(--xh-control-px-sm);
451
+ padding-inline: var(--xh-date-picker-confirm-trigger-px, var(--xh-control-px-sm));
442
452
  border: none;
443
- border-radius: var(--xh-shape-control);
453
+ border-radius: var(--xh-date-picker-confirm-trigger-radius, var(--xh-shape-control));
444
454
  background: var(--xh-date-picker-confirm-bg, var(--xh-_date-picker-accent));
445
455
  color: var(--xh-date-picker-confirm-fg, var(--xh-_date-picker-accent-fg));
446
456
  font-size: var(--xh-text-secondary-size);
@@ -12,7 +12,7 @@
12
12
  --xh-_descriptions-label-gap: var(--xh-space-2);
13
13
  --xh-_descriptions-py: var(--xh-space-2);
14
14
  --xh-_descriptions-px: var(--xh-space-3);
15
- --xh-_descriptions-font-size: var(--xh-text-body-size);
15
+ --xh-_descriptions-font-size: var(--xh-control-font-md);
16
16
  /* 标签在左时那一列的宽度:收到最长的那个标签 */
17
17
  --xh-_descriptions-label-w: max-content;
18
18
 
@@ -117,9 +117,9 @@
117
117
  > [data-scope='descriptions'][data-part='item'] {
118
118
  padding-block: var(--xh-descriptions-item-py, var(--xh-_descriptions-py));
119
119
  padding-inline: var(--xh-descriptions-item-px, var(--xh-_descriptions-px));
120
- border-block-start: var(--xh-stroke-thin) solid var(--xh-descriptions-border, var(--xh-border-subtle));
120
+ border-block-start: var(--xh-stroke-thin) solid var(--xh-descriptions-divider, var(--xh-border-subtle));
121
121
  /* 每行一组时左边没有邻居,宽度按列数补回来 */
122
- border-inline-start: 0 solid var(--xh-descriptions-border, var(--xh-border-subtle));
122
+ border-inline-start: 0 solid var(--xh-descriptions-divider, var(--xh-border-subtle));
123
123
  }
124
124
 
125
125
  [data-scope='descriptions'][data-part='root'][data-bordered]
@@ -202,4 +202,10 @@
202
202
  > [data-scope='descriptions'][data-part='item']:nth-child(-n + 6) {
203
203
  border-block-start-width: 0;
204
204
  }
205
+
206
+ /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
207
+ 写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
208
+ [data-scope='descriptions'][data-part='item'][hidden] {
209
+ display: none;
210
+ }
205
211
  }
package/css/dialog.css CHANGED
@@ -81,7 +81,7 @@
81
81
  display: flex;
82
82
  align-items: center;
83
83
  justify-content: center;
84
- padding: var(--xh-space-4);
84
+ padding: var(--xh-dialog-positioner-padding, var(--xh-space-4));
85
85
  }
86
86
 
87
87
  [data-scope='dialog'][data-part='positioner'][data-position='top'] {
@@ -211,4 +211,10 @@
211
211
  -webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
212
212
  mask: var(--xh-glyph-mark-close) center / contain no-repeat;
213
213
  }
214
+
215
+ /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
216
+ 写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
217
+ [data-scope='dialog'][data-part='positioner'][hidden] {
218
+ display: none;
219
+ }
214
220
  }
package/css/drawer.css CHANGED
@@ -124,6 +124,12 @@
124
124
  display: contents;
125
125
  }
126
126
 
127
+ /* 浮层被搬到 portal 落点,继承不到 root 上的槽:这把尺在被搬走的那一侧再声明一次,
128
+ 关闭钮与条目里作者塞的图标才和皮肤画的兜底字形一样大 */
129
+ [data-scope='drawer'][data-part='content'] {
130
+ --xh-icon-size: var(--xh-drawer-icon-size, var(--xh-glyph-size-text));
131
+ }
132
+
127
133
  /* 声明了 display 就盖掉了 UA 的 [hidden]{display:none},作者手写 hidden 时得还回去 */
128
134
  [data-scope='drawer'][data-part='root'][hidden] {
129
135
  display: none;
@@ -184,11 +190,14 @@
184
190
  background: var(--xh-drawer-backdrop-bg, var(--xh-bg-overlay));
185
191
  }
186
192
 
187
- /* 挂在局部容器里:遮罩与定位层从视口坐标换成容器坐标,只罩住那个容器。
193
+ /* 挂在局部容器里:遮罩、定位层与面板一起从视口坐标换成容器坐标,只罩住那个容器。
188
194
  作者要给那个容器加 position(relative 之类),否则 absolute 会往上找到别的定位祖先——
189
- 这一条写进了示例与 props 说明 */
195
+ 这一条写进了示例与 props 说明。
196
+ content 必须一起换:它的贴边是 inset-block/inline 参照包含块算的,留在 fixed 上就会
197
+ 照旧贴视口边,遮罩缩进容器、面板却跑到屏幕边上——与 contained 的承诺正好相反 */
190
198
  [data-scope='drawer'][data-part='backdrop'][data-contained],
191
- [data-scope='drawer'][data-part='positioner'][data-contained] {
199
+ [data-scope='drawer'][data-part='positioner'][data-contained],
200
+ [data-scope='drawer'][data-part='content'][data-contained] {
192
201
  position: absolute;
193
202
  }
194
203
 
@@ -214,8 +223,9 @@
214
223
  /* 贴边写在 content 自己身上,而不是交给 positioner:
215
224
  positioner 在抽屉里不是必需部件,最小合规结构只有 root + content,
216
225
  贴边若挂在 positioner 上,那种结构下面板会直接塌回文档流。
217
- content 是 fixed,包住它的 positioner 没有 transform / filter,
218
- 不构成固定定位的包含块,两种结构下参照的都是视口,位置一致。 */
226
+ 非 contained 时 content 是 fixed,包住它的 positioner 没有 transform / filter,
227
+ 不构成固定定位的包含块,两种结构下参照的都是视口,位置一致;
228
+ contained 时上面那条把它一并换成 absolute,参照的就是作者那个容器。 */
219
229
  [data-scope='drawer'][data-part='content'] {
220
230
  /* 位移方向的私有槽位:默认按 LTR,RTL 在下面整体翻符号 */
221
231
  --xh-_drawer-shift-inline: 100%;
@@ -210,4 +210,11 @@
210
210
  -webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
211
211
  mask: var(--xh-glyph-mark-close) center / contain no-repeat;
212
212
  }
213
+
214
+ /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
215
+ 写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
216
+ [data-scope='dynamic-input'][data-part='item-content'][hidden],
217
+ [data-scope='dynamic-input'][data-part='item-action'][hidden] {
218
+ display: none;
219
+ }
213
220
  }
package/css/ellipsis.css CHANGED
@@ -43,4 +43,10 @@
43
43
  outline: var(--xh-ring-width) solid var(--xh-ring-focus);
44
44
  outline-offset: var(--xh-ring-offset);
45
45
  }
46
+
47
+ /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
48
+ 写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
49
+ [data-scope='ellipsis'][data-part='root'][hidden] {
50
+ display: none;
51
+ }
46
52
  }
@@ -8,7 +8,7 @@
8
8
  /* 三个尺寸档只换这几个私有槽,图标与标题都从 root 继承它们,
9
9
  换档不必给每个部件各写一条选择器 */
10
10
  --xh-_empty-state-gap: var(--xh-stack-gap-md);
11
- --xh-_empty-state-py: var(--xh-section-py);
11
+ --xh-_empty-state-py: var(--xh-section-py-md);
12
12
  --xh-_empty-state-icon-size: var(--xh-glyph-size-2xl);
13
13
  --xh-_empty-state-title-size: var(--xh-control-font-lg);
14
14
  /* 说明的读行宽度:整句话不收窄就会拉成一条难读的长行 */
@@ -31,15 +31,15 @@
31
31
  }
32
32
 
33
33
  [data-scope='empty-state'][data-part='root'][data-size='sm'] {
34
- --xh-_empty-state-gap: var(--xh-space-2);
35
- --xh-_empty-state-py: var(--xh-space-4);
34
+ --xh-_empty-state-gap: var(--xh-stack-gap-sm);
35
+ --xh-_empty-state-py: var(--xh-section-py-sm);
36
36
  --xh-_empty-state-icon-size: var(--xh-glyph-size-xl);
37
37
  --xh-_empty-state-title-size: var(--xh-control-font-md);
38
38
  }
39
39
 
40
40
  [data-scope='empty-state'][data-part='root'][data-size='lg'] {
41
- --xh-_empty-state-gap: var(--xh-space-6);
42
- --xh-_empty-state-py: var(--xh-space-8);
41
+ --xh-_empty-state-gap: var(--xh-stack-gap-lg);
42
+ --xh-_empty-state-py: var(--xh-section-py-lg);
43
43
  --xh-_empty-state-icon-size: var(--xh-glyph-size-3xl);
44
44
  --xh-_empty-state-title-size: var(--xh-text-heading-3-size);
45
45
  }
@@ -49,11 +49,14 @@
49
49
  align-items: center;
50
50
  justify-content: center;
51
51
  flex: none;
52
+ /* 作者塞进图标槽的 XhIcon 与皮肤画的字形同一把尺,都按展示档的图标框量 */
53
+ --xh-icon-size: var(--xh-empty-state-icon-size, var(--xh-_empty-state-icon-size));
54
+
52
55
  block-size: var(--xh-empty-state-icon-size, var(--xh-_empty-state-icon-size));
53
56
  inline-size: var(--xh-empty-state-icon-size, var(--xh-_empty-state-icon-size));
54
57
  color: var(--xh-empty-state-icon-fg, var(--xh-fg-subtle));
55
58
  /* 图标常是一个字形,字号跟着图标框走,line-height 不再另占高度 */
56
- font-size: var(--xh-empty-state-icon-font-size, var(--xh-text-heading-1-size));
59
+ font-size: var(--xh-empty-state-icon-font-size, var(--xh-_empty-state-icon-size));
57
60
  line-height: var(--xh-leading-none);
58
61
  }
59
62
 
@@ -80,4 +83,11 @@
80
83
  justify-content: center;
81
84
  gap: var(--xh-empty-state-action-gap, var(--xh-space-2));
82
85
  }
86
+
87
+ /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
88
+ 写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
89
+ [data-scope='empty-state'][data-part='icon'][hidden],
90
+ [data-scope='empty-state'][data-part='action'][hidden] {
91
+ display: none;
92
+ }
83
93
  }
package/css/field.css CHANGED
@@ -101,4 +101,11 @@
101
101
  font-size: var(--xh-field-error-font-size, var(--xh-text-secondary-size));
102
102
  line-height: var(--xh-leading-normal);
103
103
  }
104
+
105
+ /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
106
+ 写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
107
+ [data-scope='field'][data-part='root'][hidden],
108
+ [data-scope='form'][data-part='root'][hidden] {
109
+ display: none;
110
+ }
104
111
  }
@@ -193,7 +193,7 @@
193
193
  只挑图标色不换底色:底色一换,一列文件里图片那几行会跳出来抢戏。
194
194
  取语义 token 而不是品牌色阶原值,深色主题才跟着走 */
195
195
  [data-scope='file-upload'][data-part='item-preview'][data-file-type^='image/'] {
196
- color: var(--xh-file-upload-preview-fg-image, var(--xh-bg-brand));
196
+ color: var(--xh-file-upload-preview-fg-image, var(--xh-fg-brand));
197
197
  }
198
198
 
199
199
  /* 塞进来的真缩略图撑满这个方框,长宽比不对就裁掉,不许把格子顶变形 */
package/css/flex.css CHANGED
@@ -17,11 +17,11 @@
17
17
  }
18
18
 
19
19
  /* —— 方向 —— */
20
- [data-scope='flex'][data-part='root'][data-direction='row'] {
20
+ [data-scope='flex'][data-part='root'][data-orientation='horizontal'] {
21
21
  flex-direction: row;
22
22
  }
23
23
 
24
- [data-scope='flex'][data-part='root'][data-direction='column'] {
24
+ [data-scope='flex'][data-part='root'][data-orientation='vertical'] {
25
25
  flex-direction: column;
26
26
  }
27
27
 
@@ -79,22 +79,28 @@
79
79
  /* —— 间距档位 —— */
80
80
  /* 每一档指向一个间距令牌,折行时行与行之间也吃这份间距 */
81
81
  [data-scope='flex'][data-part='root'][data-gap='xs'] {
82
- gap: var(--xh-flex-gap, var(--xh-space-1));
82
+ gap: var(--xh-flex-gap, var(--xh-layout-gap-xs));
83
83
  }
84
84
 
85
85
  [data-scope='flex'][data-part='root'][data-gap='sm'] {
86
- gap: var(--xh-flex-gap, var(--xh-space-2));
86
+ gap: var(--xh-flex-gap, var(--xh-layout-gap-sm));
87
87
  }
88
88
 
89
89
  [data-scope='flex'][data-part='root'][data-gap='md'] {
90
- gap: var(--xh-flex-gap, var(--xh-space-3));
90
+ gap: var(--xh-flex-gap, var(--xh-layout-gap-md));
91
91
  }
92
92
 
93
93
  [data-scope='flex'][data-part='root'][data-gap='lg'] {
94
- gap: var(--xh-flex-gap, var(--xh-space-4));
94
+ gap: var(--xh-flex-gap, var(--xh-layout-gap-lg));
95
95
  }
96
96
 
97
97
  [data-scope='flex'][data-part='root'][data-gap='xl'] {
98
- gap: var(--xh-flex-gap, var(--xh-space-6));
98
+ gap: var(--xh-flex-gap, var(--xh-layout-gap-xl));
99
+ }
100
+
101
+ /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
102
+ 写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
103
+ [data-scope='flex'][data-part='root'][hidden] {
104
+ display: none;
99
105
  }
100
106
  }
@@ -138,4 +138,11 @@
138
138
  -webkit-mask: var(--xh-glyph-mark-plus) center / contain no-repeat;
139
139
  mask: var(--xh-glyph-mark-plus) center / contain no-repeat;
140
140
  }
141
+
142
+ /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
143
+ 写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
144
+ [data-scope='float-button'][data-part='root'][hidden],
145
+ [data-scope='float-button'][data-part='trigger'][hidden] {
146
+ display: none;
147
+ }
141
148
  }
@@ -17,6 +17,12 @@
17
17
  display: contents;
18
18
  }
19
19
 
20
+ /* 浮层被搬到 portal 落点,继承不到 root 上的槽:这把尺在被搬走的那一侧再声明一次,
21
+ 关闭钮与条目里作者塞的图标才和皮肤画的兜底字形一样大 */
22
+ [data-scope='floating-panel'][data-part='content'] {
23
+ --xh-icon-size: var(--xh-floating-panel-icon-size, var(--xh-glyph-size-text));
24
+ }
25
+
20
26
  [data-scope='floating-panel'][data-part='root'][hidden] {
21
27
  display: none;
22
28
  }
package/css/grid.css CHANGED
@@ -269,23 +269,23 @@
269
269
  /* —— 间距档位 —— */
270
270
  /* 每一档指向一个间距令牌,行与行之间也吃这同一份间距 */
271
271
  [data-scope='grid'][data-part='root'][data-gap='xs'] {
272
- gap: var(--xh-grid-gap, var(--xh-space-1));
272
+ gap: var(--xh-grid-gap, var(--xh-layout-gap-xs));
273
273
  }
274
274
 
275
275
  [data-scope='grid'][data-part='root'][data-gap='sm'] {
276
- gap: var(--xh-grid-gap, var(--xh-space-2));
276
+ gap: var(--xh-grid-gap, var(--xh-layout-gap-sm));
277
277
  }
278
278
 
279
279
  [data-scope='grid'][data-part='root'][data-gap='md'] {
280
- gap: var(--xh-grid-gap, var(--xh-space-3));
280
+ gap: var(--xh-grid-gap, var(--xh-layout-gap-md));
281
281
  }
282
282
 
283
283
  [data-scope='grid'][data-part='root'][data-gap='lg'] {
284
- gap: var(--xh-grid-gap, var(--xh-space-4));
284
+ gap: var(--xh-grid-gap, var(--xh-layout-gap-lg));
285
285
  }
286
286
 
287
287
  [data-scope='grid'][data-part='root'][data-gap='xl'] {
288
- gap: var(--xh-grid-gap, var(--xh-space-6));
288
+ gap: var(--xh-grid-gap, var(--xh-layout-gap-xl));
289
289
  }
290
290
 
291
291
  /* —— 块向对齐 —— */
@@ -430,4 +430,10 @@
430
430
  [data-scope='grid'][data-part='item'][data-offset='11'] {
431
431
  --xh-_grid-start: 12;
432
432
  }
433
+
434
+ /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
435
+ 写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
436
+ [data-scope='grid'][data-part='root'][hidden] {
437
+ display: none;
438
+ }
433
439
  }
package/css/heatmap.css CHANGED
@@ -121,10 +121,11 @@
121
121
  gap: var(--xh-heatmap-grid-gap, var(--xh-_heatmap-gap));
122
122
  }
123
123
 
124
- /* 网格自己只在没有格子可落焦点时才占 Tab 位,那几帧里也该看得出焦点在哪 */
124
+ /* 网格自己只在没有格子可落焦点时才占 Tab 位,那几帧里也该看得出焦点在哪。
125
+ 环往内收:网格铺满 root,root 那层 overflow-x: auto 会把画在外沿的环裁掉 */
125
126
  [data-scope='heatmap'][data-part='grid']:focus-visible {
126
127
  outline: var(--xh-ring-width) solid var(--xh-ring-focus);
127
- outline-offset: var(--xh-ring-offset);
128
+ outline-offset: calc(-1 * var(--xh-ring-width));
128
129
  }
129
130
 
130
131
  [data-scope='heatmap'][data-part='row'] {
package/css/highlight.css CHANGED
@@ -13,7 +13,7 @@
13
13
  /* 浏览器给 mark 的默认底色是一个固定的亮黄,暗色主题下压在深底上刺眼、
14
14
  配的黑字也不随主题走;这里整份换成随主题走的品牌淡底 */
15
15
  [data-scope='highlight'][data-part='mark'] {
16
- padding-inline: var(--xh-space-0_5);
16
+ padding-inline: var(--xh-highlight-mark-px, var(--xh-space-0_5));
17
17
  border-radius: var(--xh-highlight-radius, var(--xh-shape-inset));
18
18
  background: var(--xh-highlight-bg, var(--xh-bg-brand-subtle));
19
19
  color: var(--xh-highlight-fg, var(--xh-fg-brand-strong));
package/css/hotkeys.css CHANGED
@@ -7,7 +7,7 @@
7
7
  /* 一排键帽连着连接符。整块不换行:一组组合被折成两行就读不出是一组了 */
8
8
  [data-scope='hotkeys'][data-part='root'] {
9
9
  /* 尺寸档只换这两个私有槽,键帽从 root 继承它们,换档不必给每个部件各写一条选择器 */
10
- --xh-_hotkeys-font-size: var(--xh-text-secondary-size);
10
+ --xh-_hotkeys-font-size: var(--xh-control-caption-md);
11
11
  --xh-_hotkeys-key-px: var(--xh-space-1);
12
12
 
13
13
  display: inline-flex;
@@ -67,6 +67,9 @@
67
67
  引擎没算(尚未落位 / 无引擎 / 贴边归零)时不额外限高 */
68
68
  --xh-_hover-card-available-h: 100vh;
69
69
 
70
+ /* 卡片内容的自绘条浮在内容之上:轨道不上底色,实色轨道会在卡片右缘糊一条竖灰带 */
71
+ --xh-scrollbar-track-bg: transparent;
72
+
70
73
  position: fixed;
71
74
  z-index: var(--xh-hover-card-layer, var(--xh-layer-popover));
72
75
  /* 空壳不吃指针:trigger 与 content 之间那段间隙要能点得穿,
@@ -69,9 +69,10 @@
69
69
  cursor: not-allowed;
70
70
  }
71
71
 
72
+ /* 环往内收:裁切框长在视口里,视口那层 overflow: hidden 会把画在外沿的环裁掉 */
72
73
  [data-scope='image-cropper'][data-part='crop-area']:focus-visible {
73
74
  outline: var(--xh-ring-width) solid var(--xh-ring-focus);
74
- outline-offset: var(--xh-ring-offset);
75
+ outline-offset: calc(-1 * var(--xh-ring-width));
75
76
  }
76
77
 
77
78
  /* 三分构图参考线:两条竖线、两条横线,落点写死在三分处,不占节点、不吃指针。
@@ -134,9 +135,10 @@
134
135
  content: '';
135
136
  }
136
137
 
138
+ /* 与裁切框同一口径:把手也在视口的 overflow: hidden 里,环画在外沿会被裁掉 */
137
139
  [data-scope='image-cropper'][data-part='crop-handle']:focus-visible {
138
140
  outline: var(--xh-ring-width) solid var(--xh-ring-focus);
139
- outline-offset: var(--xh-ring-offset);
141
+ outline-offset: calc(-1 * var(--xh-ring-width));
140
142
  }
141
143
 
142
144
  [data-scope='image-cropper'][data-part='crop-handle'][data-resizing] {
@@ -54,6 +54,10 @@
54
54
  }
55
55
 
56
56
  [data-scope='image-viewer'][data-part='content'] {
57
+ /* 组件内那几档层号只在自己人之间排序:建一个层叠上下文把它们关起来,
58
+ 既不让页面上的层号插进来,也不让它们漏出去压住别人 */
59
+ isolation: isolate;
60
+
57
61
  /* 作者塞进指示符槽的图标跟着字号走,与皮肤画的兜底字形同一把尺 */
58
62
  --xh-icon-size: var(--xh-image-viewer-icon-size, var(--xh-glyph-size-text));
59
63
 
@@ -114,7 +118,7 @@
114
118
  background: var(--xh-image-viewer-chrome-bg, color-mix(in oklab, var(--xh-color-neutral-950) 55%, transparent));
115
119
  color: inherit;
116
120
  border: none;
117
- border-radius: var(--xh-shape-pill);
121
+ border-radius: var(--xh-image-viewer-overlay-radius, var(--xh-shape-pill));
118
122
  }
119
123
 
120
124
  [data-scope='image-viewer'][data-part='toolbar'] {
@@ -123,8 +127,8 @@
123
127
  translate: -50% 0;
124
128
  display: flex;
125
129
  align-items: center;
126
- gap: var(--xh-space-1);
127
- 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));
128
132
  }
129
133
 
130
134
  /* 工具条里的按钮:底色交给工具条,本体只管命中区 */
@@ -137,7 +141,7 @@
137
141
  block-size: var(--xh-control-action-size);
138
142
  background: none;
139
143
  border: none;
140
- border-radius: var(--xh-shape-control);
144
+ border-radius: var(--xh-image-viewer-toolbar-radius, var(--xh-shape-control));
141
145
  color: inherit;
142
146
  font-size: var(--xh-glyph-size-sm);
143
147
  cursor: pointer;
@@ -147,7 +151,7 @@
147
151
  inset-block-start: var(--xh-space-6);
148
152
  inset-inline-start: 50%;
149
153
  translate: -50% 0;
150
- padding: var(--xh-space-1) var(--xh-space-3);
154
+ padding: var(--xh-image-viewer-counter-padding, var(--xh-space-1) var(--xh-space-3));
151
155
  font-size: var(--xh-text-secondary-size);
152
156
  }
153
157
 
@@ -318,4 +322,13 @@
318
322
  -webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
319
323
  mask: var(--xh-glyph-mark-close) center / contain no-repeat;
320
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;
333
+ }
321
334
  }
@@ -10,7 +10,7 @@
10
10
  /* 作者塞进指示符槽的图标跟着字号走,与皮肤画的兜底字形同一把尺 */
11
11
  --xh-icon-size: var(--xh-json-viewer-icon-size, var(--xh-glyph-size-text));
12
12
 
13
- --xh-_json-viewer-font-size: var(--xh-text-secondary-size);
13
+ --xh-_json-viewer-font-size: var(--xh-control-caption-md);
14
14
  --xh-_json-viewer-row-py: var(--xh-space-0_5);
15
15
  --xh-_json-viewer-indent: var(--xh-space-4);
16
16
  --xh-json-viewer-key-fg: var(--xh-fg-brand-strong);
@@ -20,6 +20,11 @@
20
20
  --xh-json-viewer-number-fg: var(--xh-syntax-number);
21
21
  --xh-json-viewer-boolean-fg: var(--xh-syntax-keyword);
22
22
 
23
+ /* 两档的自绘条浮在内容之上:轨道不上底色,实色轨道会沿容器边缘糊出一条灰带 */
24
+ --xh-scrollbar-track-bg: transparent;
25
+
26
+ /* 自绘条绝对定位贴这一层的内边距盒,它得是定位盒 */
27
+ position: relative;
23
28
  display: block;
24
29
  color: var(--xh-json-viewer-fg, var(--xh-fg-default));
25
30
  font-family: var(--xh-json-viewer-font, var(--xh-font-family-mono));
@@ -58,6 +63,34 @@
58
63
  overflow: auto;
59
64
  }
60
65
 
66
+ /* 原文档:与树档共用同一套边框、内衬与高度令牌,两档切过去盒子不跳。
67
+ 整块可框选——这一档存在的理由就是把与后端一字不差的那份原文交到手上 */
68
+ [data-scope='json-viewer'][data-part='text'] {
69
+ margin: 0;
70
+ max-block-size: var(--xh-json-viewer-max-h, var(--xh-viewport-max-h));
71
+ padding-block: var(--xh-json-viewer-py, var(--xh-space-2));
72
+ padding-inline: var(--xh-json-viewer-px, var(--xh-space-2));
73
+ border: var(--xh-stroke-thin) solid var(--xh-json-viewer-border, var(--xh-border-default));
74
+ border-radius: var(--xh-json-viewer-radius, var(--xh-shape-surface));
75
+ background: var(--xh-json-viewer-bg, var(--xh-bg-surface));
76
+ color: var(--xh-json-viewer-text-fg, var(--xh-fg-default));
77
+ font-family: var(--xh-json-viewer-font, var(--xh-font-family-mono));
78
+ /* 缩进靠空格,行不折:折行会把层级读乱,横向给滚动条 */
79
+ white-space: pre;
80
+ tab-size: 2;
81
+ overflow: auto;
82
+ user-select: text;
83
+ }
84
+
85
+ [data-scope='json-viewer'][data-part='text'][hidden] {
86
+ display: none;
87
+ }
88
+
89
+ /* 这一档没有行可落焦,环画在整块上 */
90
+ [data-scope='json-viewer'][data-part='text']:focus-visible {
91
+ outline: var(--xh-ring-width) solid var(--xh-ring-focus);
92
+ outline-offset: calc(-1 * var(--xh-ring-width));
93
+ }
61
94
  [data-scope='json-viewer'][data-part='tree'][hidden] {
62
95
  display: none;
63
96
  }