@zazz-ui/core 0.10.0 → 0.12.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 (89) hide show
  1. package/AUTHORING.md +3 -3
  2. package/CHANGELOG.md +175 -0
  3. package/README.md +2 -2
  4. package/dist/{csp-DR-s45Kg.js → csp-LRx1fynI.js} +1 -1
  5. package/dist/sri.json +53 -53
  6. package/dist/zazz.css +1 -1
  7. package/dist/zazz.js +1 -1
  8. package/editor/zazz.css-data.json +184 -4
  9. package/editor/zazz.html-data.json +32 -0
  10. package/editor/zazz.language-data.json +209 -42
  11. package/editor/zazz.lint-data.json +1750 -1652
  12. package/package.json +5 -4
  13. package/src/base/_defaults.css +8 -2
  14. package/src/base/_properties-2xl.css +2 -0
  15. package/src/base/_properties-lg.css +2 -0
  16. package/src/base/_properties-md.css +2 -0
  17. package/src/base/_properties-sm.css +2 -0
  18. package/src/base/_properties-xl.css +2 -0
  19. package/src/base/_properties.css +6 -0
  20. package/src/base/_shadows.css +28 -28
  21. package/src/base/_utilities-box.css +3 -2
  22. package/src/base/_utilities-effects.css +25 -4
  23. package/src/base/_utilities-tier-2xl.css +1 -0
  24. package/src/base/_utilities-tier-lg.css +1 -0
  25. package/src/base/_utilities-tier-md.css +1 -0
  26. package/src/base/_utilities-tier-sm.css +1 -0
  27. package/src/base/_utilities-tier-xl.css +1 -0
  28. package/src/base/_variables.css +32 -2
  29. package/src/base/csp.d.ts.map +1 -1
  30. package/src/base/csp.js +7 -3
  31. package/src/base/csp.ts +9 -3
  32. package/src/base/kit-styling.d.ts.map +1 -1
  33. package/src/base/kit-styling.js +172 -158
  34. package/src/base/kit-styling.ts +172 -158
  35. package/src/base/utilities.d.ts +4 -1
  36. package/src/base/utilities.d.ts.map +1 -1
  37. package/src/base/utilities.js +28 -1
  38. package/src/base/utilities.ts +33 -2
  39. package/src/base/zazz-element.d.ts +1 -1
  40. package/src/base/zazz-element.js +1 -1
  41. package/src/base/zazz-element.ts +1 -1
  42. package/src/manifest.d.ts +1 -1
  43. package/src/manifest.d.ts.map +1 -1
  44. package/src/manifest.js +10 -2
  45. package/src/manifest.ts +10 -2
  46. package/src/primitives/accordion/accordion.css +61 -12
  47. package/src/primitives/alert-dialog/alert-dialog.html +14 -14
  48. package/src/primitives/badge/badge.css +33 -9
  49. package/src/primitives/button/button.css +57 -16
  50. package/src/primitives/callout/callout.css +2 -0
  51. package/src/primitives/card/card-article.html +115 -0
  52. package/src/primitives/card/card-horizontal.html +83 -0
  53. package/src/primitives/card/card-login.html +56 -0
  54. package/src/primitives/card/card-product.html +78 -0
  55. package/src/primitives/card/card-subgrid.html +96 -295
  56. package/src/primitives/card/card.css +189 -9
  57. package/src/primitives/card/card.html +110 -147
  58. package/src/primitives/carousel/carousel.html +4 -4
  59. package/src/primitives/checkbox/checkbox.css +11 -0
  60. package/src/primitives/combobox/combobox.css +47 -5
  61. package/src/primitives/command/command-dialog.html +109 -107
  62. package/src/primitives/command/command.css +16 -8
  63. package/src/primitives/debug/audit-core.d.ts.map +1 -1
  64. package/src/primitives/debug/audit-core.js +17 -0
  65. package/src/primitives/debug/audit-core.ts +16 -0
  66. package/src/primitives/dialog/dialog.css +94 -40
  67. package/src/primitives/fields/fields.css +2 -0
  68. package/src/primitives/input/input.css +27 -3
  69. package/src/primitives/input-group/input-group.css +15 -5
  70. package/src/primitives/layout/layout.css +2 -0
  71. package/src/primitives/layout/layout.html +8 -11
  72. package/src/primitives/lightbox/lightbox.css +4 -4
  73. package/src/primitives/mobile-menu/mobile-menu.css +17 -16
  74. package/src/primitives/mobile-menu/mobile-menu.html +4 -4
  75. package/src/primitives/navigation-menu/navigation-menu.css +3 -3
  76. package/src/primitives/otp/otp.css +15 -2
  77. package/src/primitives/password-group/password-group.css +18 -5
  78. package/src/primitives/popover/popover.css +23 -10
  79. package/src/primitives/radio/radio.css +14 -2
  80. package/src/primitives/reveal/reveal.html +3 -3
  81. package/src/primitives/scroll-fade/scroll-fade.css +1 -1
  82. package/src/primitives/scroll-fade/scroll-fade.html +8 -12
  83. package/src/primitives/select/select.css +54 -17
  84. package/src/primitives/slider/slider.css +95 -42
  85. package/src/primitives/switch/switch.css +14 -2
  86. package/src/primitives/tabs/tabs.css +11 -2
  87. package/src/primitives/textarea/textarea.css +8 -4
  88. package/src/primitives/toggle/toggle.css +50 -4
  89. package/src/primitives/tooltip/tooltip.css +40 -25
@@ -5,7 +5,9 @@
5
5
  * @requires _layers.css, _variables.css, popover.css, button.css, fields.css,
6
6
  * dialog.css, menu.css, select.css (--ui-option-*), kbd.css (--ui-kbd-group-*)
7
7
  * @uses popovertarget + [popover="auto"]: dropdown surface, native light dismiss
8
- * @uses <dialog data-ui="dialog"> + command="show-modal": focused surface
8
+ * @uses <dialog data-ui="dialog"> + command="show-modal": focused surface; its parts carry
9
+ * data-dialog-slot="content | header | body | footer" beside the command slots, so
10
+ * dialog.css owns layout, scrolling, and the phone's full-height model
9
11
  * @uses anchor-name, anchor-scope, position-anchor: tether the popover form
10
12
  * @uses :has(): group + empty-state visibility without JavaScript
11
13
  * @tokens --ui-command-* (@layer variables); items alias --ui-option-*
@@ -44,24 +46,23 @@
44
46
  }
45
47
 
46
48
  :where(ui-command, [data-ui~="command"]) [data-command-slot~="panel"] {
47
- /* flex-direction stays ungated so the close fade (display held by the
48
- allow-discrete transition) keeps the column layout to the last frame */
49
- flex-direction: column;
50
49
  --_min-w-len: var(--_min-w-resolved, var(--ui-command-min-w));
51
50
  --_min-w-num: var(--_min-w-resolved, var(--ui-command-min-w));
52
51
  min-inline-size: calc(var(--_min-w-len) + var(--_min-w-num) * var(--spacing));
53
52
  box-shadow: var(--ui-command-shadow);
54
53
  }
55
54
 
56
- /* Only display is gated; unconditional it would defeat the UA's
57
- display: none on closed popovers and dialogs */
58
- :where(ui-command, [data-ui~="command"])
59
- [data-command-slot~="panel"]:where(:popover-open, [open]) {
55
+ /* Popover form only: the dialog form keeps dialog.css's grid. Display is gated on
56
+ the open state (unconditional, it would defeat the UA's display: none on a
57
+ closed popover); flex-direction stays ungated so the close fade (display held
58
+ by the allow-discrete transition) keeps the column layout to the last frame */
59
+ :where(ui-command, [data-ui~="command"]) [data-command-slot~="panel"]:where(:popover-open) {
60
60
  display: flex;
61
61
  }
62
62
 
63
63
  :where(ui-command, [data-ui~="command"]) [data-command-slot~="panel"]:where([popover]) {
64
64
  position-anchor: --ui-command-trigger;
65
+ flex-direction: column;
65
66
  padding: 0;
66
67
  }
67
68
 
@@ -76,7 +77,9 @@
76
77
  /* Search input: borderless over a hairline; the panel is the surface */
77
78
  :where(ui-command, [data-ui~="command"]) [data-command-slot~="header"] {
78
79
  display: flex;
80
+ flex-direction: row;
79
81
  align-items: center;
82
+ padding: 0; /* the input carries the padding, not the dialog's header */
80
83
  border-block-end: var(--ui-command-input-border);
81
84
  }
82
85
 
@@ -101,6 +104,9 @@
101
104
  outline: none;
102
105
  }
103
106
 
107
+ /* The scroller in both forms. In the dialog form it is also the dialog's body slot,
108
+ so it inherits the scroll-fade mask, and below the sm band the dialog's
109
+ full-height rule lifts the cap. */
104
110
  :where(ui-command, [data-ui~="command"]) [data-command-slot~="list"] {
105
111
  display: flex;
106
112
  flex-direction: column;
@@ -110,6 +116,7 @@
110
116
  margin: 0;
111
117
  overflow-y: auto;
112
118
  overflow-x: clip;
119
+ overscroll-behavior: contain;
113
120
  list-style: none;
114
121
  }
115
122
 
@@ -145,6 +152,7 @@
145
152
 
146
153
  :where(ui-command, [data-ui~="command"]) [data-command-slot~="footer"] {
147
154
  display: flex;
155
+ justify-content: flex-start; /* hints read left to right; the dialog's footer ends */
148
156
  align-items: center;
149
157
  gap: calc(var(--spacing) * 2);
150
158
  padding: var(--ui-command-footer-p);
@@ -1 +1 @@
1
- {"version":3,"file":"audit-core.d.ts","sourceRoot":"","sources":["audit-core.ts"],"names":[],"mappings":"AA8BA,sEAAsE;AACtE,MAAM,MAAM,MAAM,GACd,iBAAiB,GACjB,aAAa,GACb,mBAAmB,GACnB,cA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,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,2FAA2F;AAC3F,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,IAAI,EAAE,OAAO,EACb,SAAS,EAAE,CAAC,EAAE,EACd,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,MAAM,EACvB,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,YAAY,GAAG,IAAI,EACvC,SAAS,GAAE,iBAAiB,GAAG,wBAA4C,GAC1E;IAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,CAAA;CAAE,CAgD9C"}
@@ -362,6 +362,23 @@ export function auditNode(node, context) {
362
362
  span: stops[2].span,
363
363
  });
364
364
  }
365
+ // a mask needs --mask-linear and --mask-stops, both at the base
366
+ const maskType = declared("mask-linear");
367
+ const maskStops = declared("mask-stops");
368
+ if (maskType && !maskStops) {
369
+ found.push({
370
+ rule: "gradient-incomplete",
371
+ message: `\`${maskType[1]}\` masks nothing without \`--mask-stops\` (the mask's stops).`,
372
+ span: maskType[2].span,
373
+ });
374
+ }
375
+ else if (maskStops && !maskType) {
376
+ found.push({
377
+ rule: "gradient-incomplete",
378
+ message: "`--mask-stops` masks nothing without `--mask-linear` (the mask's direction).",
379
+ span: maskStops[2].span,
380
+ });
381
+ }
365
382
  if (types.length > 1) {
366
383
  found.push({
367
384
  rule: "gradient-incomplete",
@@ -551,6 +551,22 @@ export function auditNode(node: AuditNode, context: AuditContext): Finding[] {
551
551
  span: stops[2].span,
552
552
  });
553
553
  }
554
+ // a mask needs --mask-linear and --mask-stops, both at the base
555
+ const maskType = declared("mask-linear");
556
+ const maskStops = declared("mask-stops");
557
+ if (maskType && !maskStops) {
558
+ found.push({
559
+ rule: "gradient-incomplete",
560
+ message: `\`${maskType[1]}\` masks nothing without \`--mask-stops\` (the mask's stops).`,
561
+ span: maskType[2].span,
562
+ });
563
+ } else if (maskStops && !maskType) {
564
+ found.push({
565
+ rule: "gradient-incomplete",
566
+ message: "`--mask-stops` masks nothing without `--mask-linear` (the mask's direction).",
567
+ span: maskStops[2].span,
568
+ });
569
+ }
554
570
  if (types.length > 1) {
555
571
  found.push({
556
572
  rule: "gradient-incomplete",
@@ -15,10 +15,12 @@
15
15
  * is read raw and takes a length or keyword; a --h utility or tier takes a scale
16
16
  * number or a length; a keyword tier needs a base --h, or it renders as auto)
17
17
  * @presets data-dialog-size="sm | md | lg | xl | 2xl | full | bleed" (the layout bands; sm when absent)
18
- * @uses @media (width < 40rem) + @container style(--ui-dialog-mobile-size) — below the sm
19
- * band every dialog takes the hook's size (layout-bleed by default) over its preset;
20
- * style queries are Firefox 151+, Chrome 111+, Safari 18+, an older engine keeps the preset
21
- * @consumedby alert-dialog.css, mobile-menu.css
18
+ * @uses @media (width < 40rem) and (not (hover: hover)) + @container style(--ui-dialog-mobile-size)
19
+ * — below the sm band on a touch screen every dialog takes the hook's size (layout-bleed
20
+ * by default) over its preset; a narrow window with a mouse keeps the preset; style
21
+ * queries are Firefox 151+, Chrome 111+, Safari 18+, an older engine keeps the preset
22
+ * @uses env(safe-area-inset-bottom) — the full-height content slot clears the home indicator
23
+ * @consumedby alert-dialog.css, command.css, lightbox.css, mobile-menu.css
22
24
  */
23
25
 
24
26
  @layer variables {
@@ -26,11 +28,13 @@
26
28
  --ui-dialog-backdrop-color: var(--color-shade-900);
27
29
  --ui-dialog-transition-duration: var(--default-transition-duration);
28
30
  --ui-dialog-transition-timing-function: var(--default-transition-timing-function);
29
- --ui-dialog-backdrop-transition-duration: calc(var(--ui-dialog-transition-duration) - 100ms);
30
- --ui-dialog-backdrop-transition-timing-function: ease;
31
+ --ui-dialog-backdrop-transition-duration: calc(var(--ui-dialog-transition-duration) / 2);
32
+ --ui-dialog-backdrop-transition-timing-function: var(--bezier-easing);
31
33
  --ui-dialog-backdrop-filter: none;
32
34
  --ui-dialog-shadow: var(--shadow-lg);
33
- --ui-dialog-border: 1px solid var(--color-border);
35
+ --ui-dialog-border-width: 1px;
36
+ --ui-dialog-border-style: solid;
37
+ --ui-dialog-border-color: var(--color-border);
34
38
  /* the sm band, the default size */
35
39
  --ui-dialog-w: min(var(--layout-sm), 100% - var(--gutters) * 2);
36
40
  /* below the sm band, the size every dialog takes: layout-bleed (edge to edge, no page
@@ -67,15 +71,17 @@
67
71
 
68
72
  /* Spring-eased open/close */
69
73
  :where(dialog) {
74
+ isolation: isolate;
70
75
  margin: auto;
71
76
  max-inline-size: calc(100% - var(--space-md));
72
77
  max-block-size: calc(100% - var(--space-md));
73
- border: var(--ui-dialog-border);
78
+ border: var(--ui-dialog-border-width) var(--ui-dialog-border-style)
79
+ var(--ui-dialog-border-color);
74
80
  contain: layout style;
75
81
  opacity: var(--ui-dialog-opacity--start);
76
82
  box-shadow: var(--ui-dialog-shadow);
77
83
  overscroll-behavior: contain;
78
- overflow: auto;
84
+ overflow: hidden;
79
85
  transform: translate3d(var(--ui-dialog-translate--start)) scale(var(--ui-dialog-scale--start));
80
86
  transition:
81
87
  opacity var(--ui-dialog-transition-duration) var(--ui-dialog-transition-timing-function),
@@ -102,16 +108,17 @@
102
108
  }
103
109
  }
104
110
 
105
- /* Backdrop fades via a discrete transition */
111
+ /* Backdrop fades via a discrete transition. Twice the viewport tall: with the
112
+ software keyboard up, iOS shows the page below the rect fixed boxes fill, and a
113
+ fixed box past the viewport edge creates no scroll. */
106
114
  :where(dialog)::backdrop {
107
115
  position: fixed;
108
116
  inline-size: 100%;
109
117
  block-size: 100%;
110
118
  inset: 0;
111
- z-index: 1000;
112
119
  opacity: 0;
113
120
  overscroll-behavior: contain;
114
- overflow: auto;
121
+ overflow: clip;
115
122
  background-color: var(--ui-dialog-backdrop-color);
116
123
  backdrop-filter: var(--ui-dialog-backdrop-filter);
117
124
  transition: opacity var(--ui-dialog-backdrop-transition-duration)
@@ -195,6 +202,8 @@
195
202
  container-name: dialog;
196
203
  font-size: var(--font-size-md);
197
204
  isolation: isolate;
205
+ overflow: auto;
206
+ overscroll-behavior: contain;
198
207
  }
199
208
 
200
209
  /* A one-row grid, so the content slot is capped by the dialog's height rather than
@@ -231,9 +240,8 @@
231
240
  grid-template-rows: auto minmax(0, 1fr) auto;
232
241
  position: relative;
233
242
  min-block-size: 0;
234
- /* a centred grid item sizes to its content; the cap is what hands the body its scroll */
235
243
  max-block-size: 100%;
236
- overflow: clip;
244
+ overscroll-behavior: contain;
237
245
  }
238
246
 
239
247
  :where([data-ui~="dialog"]) [data-dialog-slot~="header"] {
@@ -244,32 +252,48 @@
244
252
  padding-block-start: var(--space-sm);
245
253
  }
246
254
 
247
- :where([data-ui~="dialog"]) [data-dialog-slot~="header"]::after {
248
- content: "";
249
- display: block;
250
- position: absolute;
251
- inset-block-start: 100%;
252
- inline-size: 100%;
253
- block-size: var(--space-md);
254
- background: linear-gradient(to top, transparent, var(--ui-dialog-bg));
255
- }
256
-
257
255
  :where([data-ui~="dialog"]) [data-dialog-slot~="body"] {
256
+ --_scroll-fade-gradient: linear-gradient(
257
+ to bottom,
258
+ transparent 0,
259
+ #000 var(--_scroll-fade-start),
260
+ #000 calc(100% - var(--_scroll-fade-end)),
261
+ transparent 100%
262
+ );
263
+
258
264
  grid-row: 2;
259
265
  display: grid;
266
+ /* a full-height body keeps its rows at the top rather than spreading them */
267
+ align-content: start;
260
268
  padding-inline: var(--space-sm);
261
269
  padding-block: var(--space-md);
262
- min-block-size: 0;
263
- min-block-size: var(--space-xl);
264
- overflow-x: clip;
270
+ min-block-size: fit-content;
271
+ max-block-size: 100%;
272
+ overscroll-behavior: contain;
265
273
  overflow-y: auto;
266
- scrollbar-gutter: stable both-edges;
274
+
275
+ -webkit-mask-image: var(--ui-scroll-fade-mask, var(--_scroll-fade-gradient));
276
+ mask-image: var(--ui-scroll-fade-mask, var(--_scroll-fade-gradient));
277
+ -webkit-mask-composite: source-in;
278
+ mask-composite: intersect;
279
+ -webkit-mask-repeat: no-repeat;
280
+ mask-repeat: no-repeat;
281
+
282
+ @supports (animation-timeline: scroll()) {
283
+ animation:
284
+ ui-scroll-fade-reveal-start 1ms ease-in-out,
285
+ ui-scroll-fade-reveal-end 1ms ease-in-out;
286
+ }
287
+
288
+ @supports not (animation-timeline: scroll()) {
289
+ --_scroll-fade-start: var(--ui-scroll-fade-size);
290
+ --_scroll-fade-end: var(--ui-scroll-fade-size);
291
+ }
267
292
  }
268
293
 
269
294
  :where([data-ui~="dialog"]) [data-dialog-slot~="footer"] {
270
295
  grid-row: 3;
271
296
  block-size: fit-content;
272
- position: sticky;
273
297
  inset-block-end: 0;
274
298
  display: flex;
275
299
  justify-content: flex-end;
@@ -308,12 +332,12 @@
308
332
  }
309
333
 
310
334
  :where([data-ui~="dialog"][data-dialog-size="bleed"]) {
311
- --_dialog-w: 100vi;
312
- --_dialog-h: 100svh;
335
+ --_dialog-w: 100dvi;
336
+ --_dialog-h: 100dvb;
313
337
  --_dialog-radius: 0;
314
338
  --_dialog-shadow: none;
315
- max-inline-size: 100vi;
316
- max-block-size: 100svh;
339
+ max-inline-size: 100dvi;
340
+ max-block-size: 100dvb;
317
341
  }
318
342
 
319
343
  /* Below the sm band the viewport is a phone, and every dialog takes --ui-dialog-mobile-size
@@ -322,21 +346,51 @@
322
346
  for the site, or on one dialog's parent for that dialog alone. A viewport query, not a
323
347
  container one, because a top-layer dialog is sized by the viewport. Style queries are
324
348
  Firefox 151+; an older engine keeps the preset. */
325
- @media (width < 40rem) {
349
+ @media (width < 40rem) and (not (hover: hover)) {
326
350
  @container style(--ui-dialog-mobile-size: layout-bleed) {
351
+ /* Not :where(): the viewport decides the height here, over a consumer's own cap
352
+ on the same element (command's list max-block-size loads later at equal
353
+ specificity). Utilities still win through the layer order. */
354
+ [data-ui~="dialog"] [data-dialog-slot~="content"] {
355
+ place-content: start stretch;
356
+ block-size: 100%;
357
+ padding-block-end: env(safe-area-inset-bottom, 0px);
358
+ }
359
+
360
+ [data-ui~="dialog"] [data-dialog-slot~="body"] {
361
+ block-size: 100%;
362
+ max-block-size: 100%;
363
+ margin-block-end: auto;
364
+ }
365
+
327
366
  :where([data-ui~="dialog"]) {
328
- --_dialog-w: 100vi;
329
- --_dialog-h: 100svh;
367
+ --ui-dialog-border-color: transparent;
368
+
369
+ --_dialog-w: 100dvi;
370
+ --_dialog-h: 100dvb;
330
371
  --_dialog-radius: 0;
331
- --_dialog-shadow: none;
332
- max-inline-size: 100vi;
333
- max-block-size: 100svh;
372
+
373
+ margin: 0;
374
+ max-inline-size: 100dvi;
375
+ max-block-size: 100dvb;
376
+ overflow: scroll;
377
+ overscroll-behavior: contain;
378
+ container: none;
379
+ }
380
+
381
+ :where(dialog)::backdrop {
382
+ inline-size: 100dvi;
383
+ block-size: 100dvb;
384
+ inset: 0;
385
+ opacity: 0;
386
+ overscroll-behavior: contain;
387
+ overflow: clip;
334
388
  }
335
389
  }
336
390
 
337
391
  @container style(--ui-dialog-mobile-size: layout-full) {
338
392
  :where([data-ui~="dialog"]) {
339
- --_dialog-w: calc(100% - var(--gutters) * 2);
393
+ --_dialog-w: calc(100dvi - var(--gutters) * 2);
340
394
  }
341
395
  }
342
396
  }
@@ -52,6 +52,8 @@
52
52
  --ui-field-h: calc(var(--spacing) * 8);
53
53
  --ui-field-font-size: var(--font-size-sm);
54
54
  --ui-field-leading: 1;
55
+ /* a length, like --ui-field-px: several controls read it raw */
56
+ --ui-field-py: calc(var(--spacing) * 1.75);
55
57
  --ui-field-px: calc(var(--spacing) * 2.5);
56
58
  --ui-field-addon-p: var(--spacing);
57
59
  --ui-field-gap: calc(var(--spacing) * 2);
@@ -9,6 +9,8 @@
9
9
  * inputs (webkit.org/b/301648)
10
10
  * @uses corner-shape — superellipse corners; unsupported browsers keep plain
11
11
  * rounded corners
12
+ * @uses --_touch-min (touch screens) — the field grows to the touch floor,
13
+ * and each inline side gains half of what the height grew
12
14
  * @tokens --ui-input-* (@layer variables; surface colors and height read the
13
15
  * --ui-field-* family directly)
14
16
  */
@@ -19,6 +21,7 @@
19
21
  --ui-input-min-w: 16ch;
20
22
  --ui-input-pl: var(--ui-field-px);
21
23
  --ui-input-pr: var(--ui-field-px);
24
+ --ui-input-py: var(--ui-field-py);
22
25
  --ui-input-font-size: var(--ui-field-font-size);
23
26
  --ui-input-leading: var(--ui-field-leading);
24
27
  --ui-input-border-width: var(--ui-field-border-width);
@@ -55,13 +58,34 @@
55
58
  min-inline-size: calc(var(--_min-w-len) + var(--_min-w-num) * var(--spacing));
56
59
  --_h-len: var(--_h-resolved, var(--ui-field-h));
57
60
  --_h-num: var(--_h-resolved, var(--ui-field-h));
58
- block-size: calc(var(--_h-len) + var(--_h-num) * var(--spacing));
61
+ /* never shorter than one line plus --ui-input-py and the border above and below,
62
+ so a small --spacing can't squeeze the text against the border. The browser
63
+ centers the text in the box; a --py utility replaces --ui-input-py here and
64
+ also pads the block axis, so the line still fits. */
65
+ --_py-len: var(--_py-resolved, var(--ui-input-py));
66
+ --_py-num: var(--_py-resolved, var(--ui-input-py));
67
+ block-size: max(
68
+ calc(var(--_h-len) + var(--_h-num) * var(--spacing)),
69
+ var(--_touch-min),
70
+ calc(
71
+ 1lh + 2 *
72
+ (
73
+ var(--_py-len) + var(--_py-num) * var(--spacing) +
74
+ var(--_border-width-resolved, var(--ui-input-border-width))
75
+ )
76
+ )
77
+ );
78
+ /* half of what the touch floor added to the height, on each inline side */
79
+ --_touch-px: max(
80
+ 0px,
81
+ (var(--_touch-min) - calc(var(--_h-len) + var(--_h-num) * var(--spacing))) / 2
82
+ );
59
83
  --_pl-len: var(--_pl-resolved, var(--ui-input-pl));
60
84
  --_pl-num: var(--_pl-resolved, var(--ui-input-pl));
61
- padding-inline-start: calc(var(--_pl-len) + var(--_pl-num) * var(--spacing));
85
+ padding-inline-start: calc(var(--_pl-len) + var(--_pl-num) * var(--spacing) + var(--_touch-px));
62
86
  --_pr-len: var(--_pr-resolved, var(--ui-input-pr));
63
87
  --_pr-num: var(--_pr-resolved, var(--ui-input-pr));
64
- padding-inline-end: calc(var(--_pr-len) + var(--_pr-num) * var(--spacing));
88
+ padding-inline-end: calc(var(--_pr-len) + var(--_pr-num) * var(--spacing) + var(--_touch-px));
65
89
 
66
90
  font-size: var(--_font-size-resolved, var(--ui-input-font-size));
67
91
  line-height: var(--_leading-resolved, var(--ui-input-leading));
@@ -5,6 +5,8 @@
5
5
  * @requires _layers.css, _variables.css, fields.css, input.css,
6
6
  * textarea.css, button.css
7
7
  * @uses :focus-within — lifts shell ring/border as one field
8
+ * @uses --_touch-min (touch screens) — the shell and its addons grow to the touch floor,
9
+ * and the input's inline sides gain half of what the height grew
8
10
  * @uses :has() — restore padding when addons absent; invalid text color
9
11
  * @uses data-input-group-align on the addon slot — inline-start/end, block-start/end
10
12
  * @uses corner-shape — superellipse corners; unsupported browsers keep plain
@@ -65,7 +67,15 @@
65
67
  inline-size: calc(var(--_w-len) + var(--_w-num) * var(--spacing));
66
68
  --_min-h-len: var(--_min-h-resolved, var(--ui-input-group-min-h));
67
69
  --_min-h-num: var(--_min-h-resolved, var(--ui-input-group-min-h));
68
- min-block-size: calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing));
70
+ min-block-size: max(
71
+ calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing)),
72
+ var(--_touch-min)
73
+ );
74
+ /* half of what the floor added to the shell's height; inherits to the input inside */
75
+ --_group-touch-px: max(
76
+ 0px,
77
+ (var(--_touch-min) - calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing))) / 2
78
+ );
69
79
  --_p-len: var(--_p-resolved, var(--ui-input-group-p));
70
80
  --_p-num: var(--_p-resolved, var(--ui-input-group-p));
71
81
  padding: calc(var(--_p-len) + var(--_p-num) * var(--spacing));
@@ -155,14 +165,14 @@
155
165
  )
156
166
  )
157
167
  [data-ui~="input"] {
158
- padding-inline-start: var(--ui-field-px);
168
+ padding-inline-start: calc(var(--ui-field-px) + var(--_group-touch-px));
159
169
  }
160
170
 
161
171
  :where([data-ui~="input-group"]):not(
162
172
  :has([data-input-group-slot~="addon"][data-input-group-align="inline-end"])
163
173
  )
164
174
  [data-ui~="input"] {
165
- padding-inline-end: var(--ui-field-px);
175
+ padding-inline-end: calc(var(--ui-field-px) + var(--_group-touch-px));
166
176
  }
167
177
 
168
178
  /* A textarea claims the full width; addons stack above/below via block-* */
@@ -182,8 +192,8 @@
182
192
  gap: var(--spacing);
183
193
  color: var(--color-muted-foreground);
184
194
  white-space: nowrap;
185
- block-size: var(--ui-field-h);
186
- min-inline-size: var(--ui-field-h);
195
+ block-size: max(var(--ui-field-h), var(--_touch-min));
196
+ min-inline-size: max(var(--ui-field-h), var(--_touch-min));
187
197
  padding-inline: var(--ui-field-addon-p);
188
198
  }
189
199
 
@@ -96,6 +96,8 @@
96
96
  column-gap: 0;
97
97
  /* children sit at the block start and stretch across their band */
98
98
  place-items: start stretch;
99
+ /* and the rows pack at the top of a layout taller than its content */
100
+ align-content: start;
99
101
  /* a container context would break a nested subgrid */
100
102
  container-type: normal;
101
103
  }
@@ -1,16 +1,14 @@
1
1
  <ui-layout style="--gap: 4">
2
- <div data-ui="card" style="--p: 4">Default band (xl)</div>
3
- <div
4
- data-ui="card"
2
+ <ui-card style="--p: 4">Default band (xl)</ui-card>
3
+ <ui-card
5
4
  style="
6
5
  --band: layout-md;
7
6
  --p: 4;
8
7
  "
9
8
  >
10
9
  --band: layout-md
11
- </div>
12
- <div
13
- data-ui="card"
10
+ </ui-card>
11
+ <ui-card
14
12
  style="
15
13
  --band: layout-bleed;
16
14
  --p: 4;
@@ -18,9 +16,8 @@
18
16
  "
19
17
  >
20
18
  --band: layout-bleed
21
- </div>
22
- <div
23
- data-ui="card"
19
+ </ui-card>
20
+ <ui-card
24
21
  style="
25
22
  --band: layout-sm;
26
23
  --band--lg: layout-xl;
@@ -28,8 +25,8 @@
28
25
  "
29
26
  >
30
27
  --band: layout-sm, --band--lg: layout-xl
31
- </div>
28
+ </ui-card>
32
29
  <ui-layout data-layout-size="md" style="--band: layout-bleed">
33
- <div data-ui="card" style="--p: 4">nested layout, data-layout-size="md"</div>
30
+ <ui-card style="--p: 4">nested layout, data-layout-size="md"</ui-card>
34
31
  </ui-layout>
35
32
  </ui-layout>
@@ -333,7 +333,7 @@
333
333
  :where(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="dialog"] {
334
334
  --ui-lightbox-thumb-radius: var(--radius-sm);
335
335
  --ui-dialog-bg: transparent;
336
- --ui-dialog-border: none;
336
+ --ui-dialog-border-width: 0;
337
337
 
338
338
  overflow: clip;
339
339
  pointer-events: none;
@@ -352,8 +352,8 @@
352
352
  [data-lightbox-slot~="dialog"]
353
353
  [data-dialog-slot~="content"] {
354
354
  grid-template-rows: 1fr;
355
- max-block-size: 100svh;
356
- block-size: 100svh;
355
+ max-block-size: 100%;
356
+ block-size: 100%;
357
357
  overflow: clip;
358
358
  }
359
359
 
@@ -363,7 +363,7 @@
363
363
  display: grid;
364
364
  grid-template-rows: 1fr auto;
365
365
  block-size: 100%;
366
- max-block-size: 100svh;
366
+ max-block-size: 100%;
367
367
  }
368
368
 
369
369
  :where(ui-lightbox, [data-ui~="lightbox"])
@@ -4,11 +4,14 @@
4
4
  *
5
5
  * @layer variables, components
6
6
  * @requires _layers.css, _variables.css, dialog.css, accordion.css
7
- * @uses Composes [data-ui~="dialog"][data-dialog-size="bleed"] — fullscreen native <dialog>
7
+ * @uses Composes [data-ui~="dialog"][data-dialog-size="bleed"] — fullscreen native <dialog>;
8
+ * the slots carry data-dialog-slot="content | header | body | footer" beside their own,
9
+ * so dialog.css owns the grid, the body scroller, and the safe-area padding
8
10
  * @uses Invoker Commands (command="show-modal") — open without JS (markup)
9
11
  * @uses view-transition-name — stable menu across navigations
10
12
  * @uses @starting-style — viewport enter animation
11
13
  * @uses Overrides --ui-dialog-* motion tokens for slide-right variant
14
+ * @uses :dir(rtl): slide-right mirrors to enter from the inline-start (right) edge
12
15
  * @tokens --ui-mobile-menu-* (@layer variables)
13
16
  * @presets data-mobile-menu-animation="slide-right"
14
17
  */
@@ -45,7 +48,6 @@
45
48
  :where([data-ui~="mobile-menu"]) {
46
49
  /* View transitions - keeps the menu stable when navigating between pages */
47
50
  view-transition-name: global-mobile-menu;
48
- inline-size: 100%;
49
51
 
50
52
  --ui-dialog-bg: var(--ui-mobile-menu-bg);
51
53
  --ui-dialog-text: var(--ui-mobile-menu-text);
@@ -57,15 +59,12 @@
57
59
  background-color: var(--ui-mobile-menu-backdrop-color);
58
60
  }
59
61
 
62
+ /* The dialog's content slot supplies the grid; a menu is full-screen at every width,
63
+ so it fills the dialog here too (the dialog does that only below the sm band) */
60
64
  :where([data-ui~="mobile-menu"]) [data-mobile-menu-slot~="viewport"] {
61
- display: grid;
62
- position: relative;
63
- grid-template-rows: auto 1fr auto;
65
+ block-size: 100%;
64
66
  overflow: clip;
65
67
  align-items: start;
66
- inline-size: 100%;
67
- block-size: 100%;
68
- max-block-size: 100svh;
69
68
  transition: var(--default-transition);
70
69
  transition-duration: var(--ui-dialog-transition-duration);
71
70
  transition-delay: calc(var(--ui-dialog-transition-duration) / 1.5);
@@ -91,31 +90,26 @@
91
90
  padding-inline: var(--ui-mobile-menu-header-px);
92
91
  padding-block: var(--ui-mobile-menu-header-py);
93
92
  border-block-end: 1px solid var(--color-border);
94
- position: sticky;
95
- inset-block-start: 0;
96
93
  background-color: var(--ui-mobile-menu-bg);
97
94
  z-index: 1;
98
95
  }
99
96
 
97
+ /* The dialog's body slot scrolls; this shapes the interior */
100
98
  :where([data-ui~="mobile-menu"]) [data-mobile-menu-slot~="body"] {
101
99
  display: flex;
102
100
  flex-direction: column;
103
- overflow-y: auto;
104
- overflow-x: clip;
105
101
  padding-inline: var(--ui-mobile-menu-body-px);
106
102
  padding-block: var(--ui-mobile-menu-body-py);
107
- max-block-size: 100%;
108
103
  scrollbar-gutter: stable both-edges;
109
104
  }
110
105
 
111
106
  :where([data-ui~="mobile-menu"]) [data-mobile-menu-slot~="footer"] {
112
107
  display: flex;
113
108
  flex-wrap: wrap;
109
+ justify-content: flex-start;
114
110
  gap: var(--ui-mobile-menu-footer-gap);
115
111
  padding: var(--ui-mobile-menu-footer-p);
116
112
  border-block-start: 1px solid var(--color-border);
117
- position: sticky;
118
- inset-block-end: 0;
119
113
  background-color: var(--ui-mobile-menu-bg);
120
114
  }
121
115
 
@@ -146,7 +140,14 @@
146
140
  --ui-dialog-translate--start: -100%, 0, 0;
147
141
  --ui-dialog-translate--end: 0, 0, 0;
148
142
 
149
- overflow: clip;
150
143
  transform-origin: left center;
151
144
  }
145
+
146
+ /* Translate and transform-origin are physical: in RTL the menu enters from
147
+ the inline-start (right) edge instead. */
148
+ :where([data-ui~="mobile-menu"][data-mobile-menu-animation="slide-right"]:dir(rtl)) {
149
+ --ui-dialog-translate--start: 100%, 0, 0;
150
+ --ui-mobile-menu-viewport-translate--start: 2rem, 1rem, 0;
151
+ transform-origin: right center;
152
+ }
152
153
  }