@zazz-ui/core 0.11.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 (79) hide show
  1. package/AUTHORING.md +3 -3
  2. package/CHANGELOG.md +120 -0
  3. package/README.md +2 -2
  4. package/dist/{csp-DR-s45Kg.js → csp-LRx1fynI.js} +1 -1
  5. package/dist/sri.json +46 -46
  6. package/dist/zazz.css +1 -1
  7. package/dist/zazz.js +1 -1
  8. package/editor/zazz.css-data.json +175 -3
  9. package/editor/zazz.html-data.json +32 -0
  10. package/editor/zazz.language-data.json +165 -32
  11. package/editor/zazz.lint-data.json +1691 -1612
  12. package/package.json +5 -4
  13. package/src/base/_defaults.css +6 -0
  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 +16 -11
  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 +170 -158
  34. package/src/base/kit-styling.ts +170 -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 +60 -14
  47. package/src/primitives/badge/badge.css +19 -9
  48. package/src/primitives/button/button.css +27 -14
  49. package/src/primitives/callout/callout.css +2 -0
  50. package/src/primitives/card/card-article.html +115 -0
  51. package/src/primitives/card/card-horizontal.html +83 -0
  52. package/src/primitives/card/card-login.html +56 -0
  53. package/src/primitives/card/card-product.html +78 -0
  54. package/src/primitives/card/card-subgrid.html +96 -295
  55. package/src/primitives/card/card.css +189 -9
  56. package/src/primitives/card/card.html +110 -147
  57. package/src/primitives/carousel/carousel.html +4 -4
  58. package/src/primitives/checkbox/checkbox.css +2 -0
  59. package/src/primitives/combobox/combobox.css +32 -6
  60. package/src/primitives/debug/audit-core.d.ts.map +1 -1
  61. package/src/primitives/debug/audit-core.js +17 -0
  62. package/src/primitives/debug/audit-core.ts +16 -0
  63. package/src/primitives/dialog/dialog.css +2 -0
  64. package/src/primitives/fields/fields.css +2 -0
  65. package/src/primitives/input/input.css +27 -4
  66. package/src/primitives/input-group/input-group.css +9 -3
  67. package/src/primitives/layout/layout.css +2 -0
  68. package/src/primitives/layout/layout.html +8 -11
  69. package/src/primitives/otp/otp.css +14 -2
  70. package/src/primitives/password-group/password-group.css +12 -3
  71. package/src/primitives/radio/radio.css +2 -0
  72. package/src/primitives/reveal/reveal.html +3 -3
  73. package/src/primitives/scroll-fade/scroll-fade.html +8 -12
  74. package/src/primitives/select/select.css +30 -6
  75. package/src/primitives/slider/slider.css +94 -44
  76. package/src/primitives/switch/switch.css +3 -2
  77. package/src/primitives/tabs/tabs.css +10 -2
  78. package/src/primitives/textarea/textarea.css +8 -4
  79. package/src/primitives/toggle/toggle.css +24 -2
@@ -1 +1 @@
1
- {"version":3,"file":"audit-core.d.ts","sourceRoot":"","sources":["audit-core.ts"],"names":[],"mappings":"AA8BA,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M,WAAW,cAAc,CAAC,CAAC;IAC/B,EAAE,EAAE,CAAC,CAAC;IACN,IAAI,EAAE,SAAS,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",
@@ -263,6 +263,8 @@
263
263
 
264
264
  grid-row: 2;
265
265
  display: grid;
266
+ /* a full-height body keeps its rows at the top rather than spreading them */
267
+ align-content: start;
266
268
  padding-inline: var(--space-sm);
267
269
  padding-block: var(--space-md);
268
270
  min-block-size: fit-content;
@@ -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,7 +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
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
13
14
  * @tokens --ui-input-* (@layer variables; surface colors and height read the
14
15
  * --ui-field-* family directly)
15
16
  */
@@ -20,6 +21,7 @@
20
21
  --ui-input-min-w: 16ch;
21
22
  --ui-input-pl: var(--ui-field-px);
22
23
  --ui-input-pr: var(--ui-field-px);
24
+ --ui-input-py: var(--ui-field-py);
23
25
  --ui-input-font-size: var(--ui-field-font-size);
24
26
  --ui-input-leading: var(--ui-field-leading);
25
27
  --ui-input-border-width: var(--ui-field-border-width);
@@ -56,13 +58,34 @@
56
58
  min-inline-size: calc(var(--_min-w-len) + var(--_min-w-num) * var(--spacing));
57
59
  --_h-len: var(--_h-resolved, var(--ui-field-h));
58
60
  --_h-num: var(--_h-resolved, var(--ui-field-h));
59
- block-size: max(calc(var(--_h-len) + var(--_h-num) * var(--spacing)), var(--_touch-min));
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
+ );
60
83
  --_pl-len: var(--_pl-resolved, var(--ui-input-pl));
61
84
  --_pl-num: var(--_pl-resolved, var(--ui-input-pl));
62
- 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));
63
86
  --_pr-len: var(--_pr-resolved, var(--ui-input-pr));
64
87
  --_pr-num: var(--_pr-resolved, var(--ui-input-pr));
65
- 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));
66
89
 
67
90
  font-size: var(--_font-size-resolved, var(--ui-input-font-size));
68
91
  line-height: var(--_leading-resolved, var(--ui-input-leading));
@@ -5,7 +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
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
9
10
  * @uses :has() — restore padding when addons absent; invalid text color
10
11
  * @uses data-input-group-align on the addon slot — inline-start/end, block-start/end
11
12
  * @uses corner-shape — superellipse corners; unsupported browsers keep plain
@@ -70,6 +71,11 @@
70
71
  calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing)),
71
72
  var(--_touch-min)
72
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
+ );
73
79
  --_p-len: var(--_p-resolved, var(--ui-input-group-p));
74
80
  --_p-num: var(--_p-resolved, var(--ui-input-group-p));
75
81
  padding: calc(var(--_p-len) + var(--_p-num) * var(--spacing));
@@ -159,14 +165,14 @@
159
165
  )
160
166
  )
161
167
  [data-ui~="input"] {
162
- padding-inline-start: var(--ui-field-px);
168
+ padding-inline-start: calc(var(--ui-field-px) + var(--_group-touch-px));
163
169
  }
164
170
 
165
171
  :where([data-ui~="input-group"]):not(
166
172
  :has([data-input-group-slot~="addon"][data-input-group-align="inline-end"])
167
173
  )
168
174
  [data-ui~="input"] {
169
- padding-inline-end: var(--ui-field-px);
175
+ padding-inline-end: calc(var(--ui-field-px) + var(--_group-touch-px));
170
176
  }
171
177
 
172
178
  /* A textarea claims the full width; addons stack above/below via block-* */
@@ -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>
@@ -18,6 +18,8 @@
18
18
  :root {
19
19
  --ui-otp-cell-w: var(--ui-field-h);
20
20
  --ui-otp-cell-h: var(--ui-field-h);
21
+ /* half the field value: the digit is larger than field text */
22
+ --ui-otp-cell-py: calc(var(--ui-field-py) / 2);
21
23
  --ui-otp-cell-bg: var(--ui-field-bg);
22
24
  --ui-otp-cell-border-width: var(--ui-field-border-width);
23
25
  --ui-otp-cell-border-style: var(--ui-field-border-style);
@@ -79,8 +81,18 @@
79
81
  :where(ui-otp, [data-ui~="otp"]) [data-otp-slot~="cell"] {
80
82
  display: grid;
81
83
  place-items: center;
82
- inline-size: max(var(--ui-otp-cell-w), var(--_touch-min));
83
- block-size: max(var(--ui-otp-cell-h), var(--_touch-min));
84
+ /* never smaller than its digit plus --ui-otp-cell-py around it, both ways, so
85
+ the cell stays square at a small --spacing */
86
+ inline-size: max(
87
+ var(--ui-otp-cell-w),
88
+ var(--_touch-min),
89
+ calc(1em + 2 * (var(--ui-otp-cell-py) + var(--ui-otp-cell-border-width)))
90
+ );
91
+ block-size: max(
92
+ var(--ui-otp-cell-h),
93
+ var(--_touch-min),
94
+ calc(1em + 2 * (var(--ui-otp-cell-py) + var(--ui-otp-cell-border-width)))
95
+ );
84
96
 
85
97
  font-family: var(--font-family-mono);
86
98
  font-size: var(--ui-otp-cell-font-size);
@@ -5,7 +5,8 @@
5
5
  * @requires _layers.css, _variables.css, fields.css, input.css,
6
6
  * button.css
7
7
  * @uses :focus-within, :has: shell focus ring and padding (as input-group.css)
8
- * @uses --_touch-min (touch screens): the shell and its addons grow to the touch floor
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
9
10
  * @uses aria-pressed on toggle — show/hide icon swap via CSS (JS sets type +
10
11
  * aria in password-group.ts)
11
12
  * @uses Native reveal suppressed in _reset.css (::-ms-reveal, etc.)
@@ -63,6 +64,11 @@
63
64
  calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing)),
64
65
  var(--_touch-min)
65
66
  );
67
+ /* half of what the floor added to the shell's height; inherits to the input inside */
68
+ --_group-touch-px: max(
69
+ 0px,
70
+ (var(--_touch-min) - calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing))) / 2
71
+ );
66
72
  --_p-len: var(--_p-resolved, var(--ui-password-group-p));
67
73
  --_p-num: var(--_p-resolved, var(--ui-password-group-p));
68
74
  padding: calc(var(--_p-len) + var(--_p-num) * var(--spacing));
@@ -137,6 +143,9 @@
137
143
 
138
144
  :where([data-ui~="password-group"]) [data-ui~="input"] {
139
145
  block-size: 100%;
146
+ /* 100% replaces input.css's height floor, so restore it here (the shell
147
+ carries the border; the --_py pair comes from input.css) */
148
+ min-block-size: calc(1lh + 2 * (var(--_py-len) + var(--_py-num) * var(--spacing)));
140
149
  padding-inline: 0;
141
150
  }
142
151
 
@@ -149,14 +158,14 @@
149
158
  )
150
159
  )
151
160
  [data-ui~="input"] {
152
- padding-inline-start: var(--ui-field-px);
161
+ padding-inline-start: calc(var(--ui-field-px) + var(--_group-touch-px));
153
162
  }
154
163
 
155
164
  :where([data-ui~="password-group"]):not(
156
165
  :has([data-password-group-slot~="addon"][data-password-group-align="inline-end"])
157
166
  )
158
167
  [data-ui~="input"] {
159
- padding-inline-end: var(--ui-field-px);
168
+ padding-inline-end: calc(var(--ui-field-px) + var(--_group-touch-px));
160
169
  }
161
170
 
162
171
  /* A textarea claims the full width; addons stack above/below via block-* */
@@ -45,6 +45,8 @@
45
45
  --_size-num: var(--_size-resolved, var(--ui-radio-size));
46
46
  inline-size: calc(var(--_size-len) + var(--_size-num) * var(--spacing));
47
47
  block-size: calc(var(--_size-len) + var(--_size-num) * var(--spacing));
48
+ min-inline-size: var(--spacing-control-min);
49
+ min-block-size: var(--spacing-control-min);
48
50
 
49
51
  background-color: var(--_bg-resolved, var(--ui-radio-bg));
50
52
 
@@ -9,7 +9,7 @@
9
9
  --w: 100%;
10
10
  "
11
11
  >
12
- <div data-ui="card" data-card-variant="muted" style="--p: 6">Arrives first</div>
13
- <div data-ui="card" data-card-variant="muted" style="--p: 6">Then this one</div>
14
- <div data-ui="card" data-card-variant="muted" style="--p: 6">Then the last</div>
12
+ <ui-card data-card-variant="muted" style="--p: 6">Arrives first</ui-card>
13
+ <ui-card data-card-variant="muted" style="--p: 6">Then this one</ui-card>
14
+ <ui-card data-card-variant="muted" style="--p: 6">Then the last</ui-card>
15
15
  </div>
@@ -29,41 +29,37 @@
29
29
  --overflow-x: auto;
30
30
  "
31
31
  >
32
- <div
33
- data-ui="card"
32
+ <ui-card
34
33
  style="
35
34
  --p: 4;
36
35
  --min-w: 60;
37
36
  "
38
37
  >
39
38
  one
40
- </div>
41
- <div
42
- data-ui="card"
39
+ </ui-card>
40
+ <ui-card
43
41
  style="
44
42
  --p: 4;
45
43
  --min-w: 60;
46
44
  "
47
45
  >
48
46
  two
49
- </div>
50
- <div
51
- data-ui="card"
47
+ </ui-card>
48
+ <ui-card
52
49
  style="
53
50
  --p: 4;
54
51
  --min-w: 60;
55
52
  "
56
53
  >
57
54
  three
58
- </div>
59
- <div
60
- data-ui="card"
55
+ </ui-card>
56
+ <ui-card
61
57
  style="
62
58
  --p: 4;
63
59
  --min-w: 60;
64
60
  "
65
61
  >
66
62
  four
67
- </div>
63
+ </ui-card>
68
64
  </div>
69
65
  </div>
@@ -13,7 +13,8 @@
13
13
  * @uses ui-multiselect (multiselect.ts): JS-projected dropdown for
14
14
  * <select multiple> (base-select has no stable multi-select);
15
15
  * degrades to the native multi listbox without JS
16
- * @uses --_touch-min (touch screens) — the trigger and every option row grow to the touch floor
16
+ * @uses --_touch-min (touch screens) — the trigger and every option row grow to the touch
17
+ * floor; the trigger's inline sides each gain half of what its height grew
17
18
  * @uses corner-shape — superellipse corners; unsupported browsers keep plain
18
19
  * rounded corners
19
20
  * @tokens --ui-select-* (@layer variables); picker panel reuses --ui-popover-* (owned in popover.css)
@@ -29,6 +30,7 @@
29
30
  --ui-select-pl: var(--ui-field-px);
30
31
  /* room for the picker icon */
31
32
  --ui-select-pr: calc(var(--spacing) * 2);
33
+ --ui-select-py: var(--ui-field-py);
32
34
  --ui-select-font-size: var(--ui-field-font-size);
33
35
  --ui-select-leading: var(--ui-field-leading);
34
36
  --ui-select-border-width: var(--ui-field-border-width);
@@ -52,6 +54,7 @@
52
54
  --ui-option-leading: var(--ui-button-leading);
53
55
  --ui-option-gap: var(--ui-button-gap);
54
56
  --ui-option-px: var(--ui-button-px);
57
+ --ui-option-py: var(--ui-button-py);
55
58
  --ui-option-min-h: var(--ui-button-min-h);
56
59
  --ui-option-icon-size: var(--ui-button-icon-size);
57
60
  --ui-option-radius: var(--ui-menu-button-radius);
@@ -171,13 +174,31 @@
171
174
  min-inline-size: calc(var(--_min-w-len) + var(--_min-w-num) * var(--spacing));
172
175
  --_h-len: var(--_h-resolved, var(--ui-field-h));
173
176
  --_h-num: var(--_h-resolved, var(--ui-field-h));
174
- block-size: max(calc(var(--_h-len) + var(--_h-num) * var(--spacing)), var(--_touch-min));
177
+ /* never shorter than one line plus --ui-select-py and the border above and below (see input.css) */
178
+ --_py-len: var(--_py-resolved, var(--ui-select-py));
179
+ --_py-num: var(--_py-resolved, var(--ui-select-py));
180
+ block-size: max(
181
+ calc(var(--_h-len) + var(--_h-num) * var(--spacing)),
182
+ var(--_touch-min),
183
+ calc(
184
+ 1lh + 2 *
185
+ (
186
+ var(--_py-len) + var(--_py-num) * var(--spacing) +
187
+ var(--_border-width-resolved, var(--ui-select-border-width))
188
+ )
189
+ )
190
+ );
191
+ /* half of what the touch floor added to the height, on each inline side */
192
+ --_touch-px: max(
193
+ 0px,
194
+ (var(--_touch-min) - calc(var(--_h-len) + var(--_h-num) * var(--spacing))) / 2
195
+ );
175
196
  --_pl-len: var(--_pl-resolved, var(--ui-select-pl));
176
197
  --_pl-num: var(--_pl-resolved, var(--ui-select-pl));
177
- padding-inline-start: calc(var(--_pl-len) + var(--_pl-num) * var(--spacing));
198
+ padding-inline-start: calc(var(--_pl-len) + var(--_pl-num) * var(--spacing) + var(--_touch-px));
178
199
  --_pr-len: var(--_pr-resolved, var(--ui-select-pr));
179
200
  --_pr-num: var(--_pr-resolved, var(--ui-select-pr));
180
- padding-inline-end: calc(var(--_pr-len) + var(--_pr-num) * var(--spacing));
201
+ padding-inline-end: calc(var(--_pr-len) + var(--_pr-num) * var(--spacing) + var(--_touch-px));
181
202
 
182
203
  font-size: var(--_font-size-resolved, var(--ui-select-font-size));
183
204
  line-height: var(--_leading-resolved, var(--ui-select-leading));
@@ -311,13 +332,15 @@
311
332
  }
312
333
  }
313
334
 
314
- /* Like [data-ui~="button"], sizing rides on min-block-size + padding-inline
315
- (no block padding) so every row is uniform. */
335
+ /* Like [data-ui~="button"], sizing rides on min-block-size + padding-inline, so
336
+ every row is uniform; --ui-option-py only shows once a small --spacing drops
337
+ the min height below the label. */
316
338
  :where([data-ui~="select"]) option {
317
339
  display: flex;
318
340
  align-items: center;
319
341
  gap: var(--ui-option-gap);
320
342
  min-block-size: max(var(--ui-option-min-h), var(--_touch-min));
343
+ padding-block: var(--ui-option-py);
321
344
  padding-inline: var(--ui-option-px);
322
345
 
323
346
  font-family: var(--ui-option-font-family);
@@ -448,6 +471,7 @@
448
471
  align-items: center;
449
472
  gap: var(--ui-option-gap);
450
473
  min-block-size: max(var(--ui-option-min-h), var(--_touch-min));
474
+ padding-block: var(--ui-option-py);
451
475
  padding-inline: var(--ui-option-px);
452
476
 
453
477
  font-family: var(--ui-option-font-family);