@voidable/theme 0.7.0 → 0.8.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 (95) hide show
  1. package/README.md +133 -8
  2. package/package.json +66 -8
  3. package/src/app-shell/detail.css +7 -5
  4. package/src/app-shell/subtable.css +7 -6
  5. package/src/base.css +28 -0
  6. package/src/components/accordion.css +96 -19
  7. package/src/components/action-input.css +51 -61
  8. package/src/components/alert.css +63 -23
  9. package/src/components/avatar.css +0 -2
  10. package/src/components/badge.css +35 -25
  11. package/src/components/banner.css +60 -19
  12. package/src/components/bar-chart.css +10 -3
  13. package/src/components/breadcrumbs.css +20 -16
  14. package/src/components/button.css +130 -55
  15. package/src/components/calendar.css +40 -17
  16. package/src/components/card.css +122 -23
  17. package/src/components/carousel.css +85 -118
  18. package/src/components/checkbox-group.css +3 -1
  19. package/src/components/checkbox.css +18 -23
  20. package/src/components/collapsible.css +95 -29
  21. package/src/components/color-picker.css +10 -10
  22. package/src/components/combobox.css +47 -29
  23. package/src/components/compose-input.css +3 -3
  24. package/src/components/dialog.css +115 -41
  25. package/src/components/divider.css +7 -4
  26. package/src/components/donut-chart.css +25 -15
  27. package/src/components/drawer.css +135 -68
  28. package/src/components/dropdown-menu.css +21 -43
  29. package/src/components/editable.css +7 -7
  30. package/src/components/error-fallback.css +48 -27
  31. package/src/components/field.css +12 -5
  32. package/src/components/file-upload.css +2 -1
  33. package/src/components/gauge.css +35 -23
  34. package/src/components/hamburger.css +10 -10
  35. package/src/components/hover-card.css +13 -113
  36. package/src/components/indicator.css +22 -18
  37. package/src/components/input.css +15 -12
  38. package/src/components/line-chart.css +10 -10
  39. package/src/components/list.css +28 -7
  40. package/src/components/menu.css +48 -33
  41. package/src/components/multiselect.css +57 -40
  42. package/src/components/nav-bar.css +23 -14
  43. package/src/components/nav-menu.css +31 -22
  44. package/src/components/number-input.css +56 -79
  45. package/src/components/overlay.css +215 -0
  46. package/src/components/pagination.css +42 -31
  47. package/src/components/panel.css +37 -11
  48. package/src/components/pin-input.css +23 -22
  49. package/src/components/popover.css +19 -35
  50. package/src/components/progress.css +19 -10
  51. package/src/components/radio-group.css +2 -1
  52. package/src/components/radio.css +15 -20
  53. package/src/components/scroll-area.css +3 -3
  54. package/src/components/segmented-control.css +46 -29
  55. package/src/components/select.css +99 -31
  56. package/src/components/sidebar.css +8 -4
  57. package/src/components/skeleton.css +8 -3
  58. package/src/components/slider.css +4 -2
  59. package/src/components/spinner.css +5 -4
  60. package/src/components/stat.css +59 -52
  61. package/src/components/status-dot.css +0 -1
  62. package/src/components/switch.css +18 -26
  63. package/src/components/table.css +443 -16
  64. package/src/components/tabs.css +92 -29
  65. package/src/components/tag.css +44 -20
  66. package/src/components/tags-input.css +43 -55
  67. package/src/components/textarea.css +15 -12
  68. package/src/components/toast.css +84 -22
  69. package/src/components/toggle.css +35 -42
  70. package/src/components/tooltip.css +19 -38
  71. package/src/core.css +98 -0
  72. package/src/forced-colors.css +134 -0
  73. package/src/index.css +4 -77
  74. package/src/knobs.css +101 -0
  75. package/src/layers.css +38 -0
  76. package/src/media/media.css +258 -0
  77. package/src/media/surface.css +143 -0
  78. package/src/patterns/data.css +461 -0
  79. package/src/patterns/page.css +348 -0
  80. package/src/patterns/shell.css +371 -0
  81. package/src/pre-upgrade.css +202 -0
  82. package/src/primitives.css +19 -97
  83. package/src/reset.css +45 -21
  84. package/src/skins/loft.css +114 -0
  85. package/src/skins/slab.css +107 -0
  86. package/src/themes/aurora.css +16 -0
  87. package/src/themes/capsule.css +16 -0
  88. package/src/themes/console.css +16 -0
  89. package/src/themes/dune.css +16 -0
  90. package/src/themes/iris.css +16 -0
  91. package/src/themes/orbit.css +16 -0
  92. package/src/themes/paper.css +18 -0
  93. package/src/themes/void.css +16 -0
  94. package/src/tokens.css +552 -98
  95. package/src/type.css +103 -0
@@ -1,35 +1,54 @@
1
1
  /* ============================================================
2
2
  void-button — Tone system component
3
+ Three variants, one size: outline (default), filled and ghost are
4
+ the same height and padding at each size step, so buttons in a row
5
+ line up whatever their variant.
3
6
  ============================================================ */
4
7
 
8
+ /* @tokens void-button
9
+ --void-button-height Height of the button. Applies at every size step; for a proportional change set the --void-control-* steps instead.
10
+ --void-button-padding Inline padding. Applies at every size step; for a proportional change set the --void-control-* steps instead.
11
+ --void-button-font-size Size of the label. Applies at every size step; for a proportional change set the --void-control-* steps instead.
12
+ --void-button-font-weight Weight of the label.
13
+ --void-button-radius Corner radius.
14
+ --void-button-border Edge colour of the default outline button. A coloured button keeps the edge of its tone; a filled one is its tone.
15
+ --void-button-shadow Shadow of the outline and filled button at rest. A ghost button never casts one. */
16
+
5
17
  void-button {
6
18
  /* Tone system — base defaults to accent (monochrome white/black) */
7
- --tone: var(--void-color-accent);
8
- --tone-text: var(--tone);
9
- --tone-subtle: color-mix(in srgb, var(--tone) 14%, transparent);
10
- --tone-border: color-mix(in srgb, var(--tone) 36%, transparent);
11
- --tone-hover: color-mix(in srgb, var(--tone) 22%, transparent);
19
+ --_void-tone: var(--void-color-accent);
20
+ --_void-tone-text: var(--void-color-text);
21
+ --_void-tone-subtle: var(--void-color-control-fill);
22
+ --_void-tone-border: var(--void-button-border, var(--void-color-border-control));
23
+ --_void-tone-hover: color-mix(in srgb, var(--_void-tone) 8%, var(--void-color-control-fill));
24
+ --_void-tone-active: color-mix(in srgb, var(--_void-tone) 13%, var(--void-color-control-fill));
25
+
26
+ /* Size — each size step sets these three and nothing else */
27
+ --_void-button-height: var(--void-button-height, var(--void-control-height));
28
+ --_void-button-padding: var(--void-button-padding, calc(var(--void-control-padding) * 1.25));
29
+ --_void-button-font-size: var(--void-button-font-size, var(--void-control-text));
12
30
 
13
31
  /* Layout */
14
32
  display: inline-flex;
15
33
  align-items: center;
16
34
  justify-content: center;
17
35
  gap: var(--void-space-2);
18
-
19
- /* Generous spacing (negative space principle) */
20
- padding: var(--void-space-2) var(--void-space-4);
36
+ min-height: var(--_void-button-height);
37
+ padding: 0 var(--_void-button-padding);
21
38
 
22
39
  /* Typography */
23
40
  font-family: var(--void-font-sans);
24
- font-size: var(--void-text-sm);
25
- font-weight: var(--void-weight-medium);
41
+ font-size: var(--_void-button-font-size);
42
+ font-weight: var(--void-button-font-weight, var(--void-weight-medium));
26
43
  line-height: var(--void-leading-tight);
44
+ white-space: nowrap;
27
45
 
28
46
  /* Visual */
29
- background: var(--tone-subtle);
30
- border: 1px solid var(--tone-border);
31
- border-radius: var(--void-radius-md);
32
- color: var(--void-color-text);
47
+ background: var(--_void-tone-subtle);
48
+ border: var(--void-control-border-width) solid var(--_void-tone-border);
49
+ border-radius: var(--void-button-radius, var(--void-control-radius));
50
+ box-shadow: var(--void-button-shadow, none);
51
+ color: var(--_void-tone-text);
33
52
  cursor: pointer;
34
53
 
35
54
  /* Motion */
@@ -41,21 +60,32 @@ void-button {
41
60
  user-select: none;
42
61
  }
43
62
 
44
- /* Hover */
63
+ /* Inline icons keep their size and sit on the text baseline */
64
+ void-button svg {
65
+ flex-shrink: 0;
66
+ vertical-align: -0.15em;
67
+ }
68
+
69
+ /* Hover and pressed */
45
70
  void-button:hover {
46
- background: var(--tone-hover);
71
+ background: var(--_void-tone-hover);
72
+ }
73
+
74
+ void-button:active {
75
+ background: var(--_void-tone-active);
47
76
  }
48
77
 
49
78
  /* Focus */
50
- void-button:focus-visible {
51
- outline: 2px solid var(--void-color-border-focus);
52
- outline-offset: 2px;
79
+ void-button:focus-visible,
80
+ void-button:has(> :is(a, button):focus-visible) {
81
+ outline: var(--void-focus-ring-width) solid var(--void-focus-ring-color);
82
+ outline-offset: var(--void-focus-ring-offset);
53
83
  }
54
84
 
55
85
  /* Filled variant */
56
86
  void-button[variant="filled"] {
57
- background: var(--tone);
58
- border-color: var(--tone);
87
+ background: var(--_void-tone);
88
+ border-color: var(--_void-tone);
59
89
  color: var(--void-color-text-on-accent);
60
90
  }
61
91
 
@@ -63,65 +93,110 @@ void-button[variant="filled"]:hover {
63
93
  opacity: 0.9;
64
94
  }
65
95
 
96
+ void-button[variant="filled"]:active {
97
+ opacity: 0.8;
98
+ }
99
+
100
+ /* Ghost variant — nothing drawn at rest: for row actions, toolbars
101
+ and the quiet button beside a primary one. */
102
+ void-button[variant="ghost"] {
103
+ --_void-tone-hover: color-mix(in srgb, var(--_void-tone) 8%, transparent);
104
+ --_void-tone-active: color-mix(in srgb, var(--_void-tone) 13%, transparent);
105
+ background: transparent;
106
+ border-color: transparent;
107
+ box-shadow: none;
108
+ }
109
+
110
+ void-button[variant="ghost"]:hover {
111
+ background: var(--_void-tone-hover);
112
+ }
113
+
114
+ void-button[variant="ghost"]:active {
115
+ background: var(--_void-tone-active);
116
+ }
117
+
66
118
  /* Color variants — one override cascades to all derived states */
67
- void-button[color="error"] { --tone: var(--void-color-error); }
68
- void-button[color="warning"] { --tone: var(--void-color-warning); }
69
- void-button[color="caution"] { --tone: var(--void-color-caution); }
70
- void-button[color="success"] { --tone: var(--void-color-success); }
71
- void-button[color="info"] { --tone: var(--void-color-info); }
72
- void-button[color="notice"] { --tone: var(--void-color-notice); }
119
+ void-button[color="error"] { --_void-tone: var(--void-color-error); }
120
+ void-button[color="warning"] { --_void-tone: var(--void-color-warning); }
121
+ void-button[color="caution"] { --_void-tone: var(--void-color-caution); }
122
+ void-button[color="highlight"] { --_void-tone: var(--void-color-highlight); }
123
+ void-button[color="success"] { --_void-tone: var(--void-color-success); }
124
+ void-button[color="info"] { --_void-tone: var(--void-color-info); }
125
+ void-button[color="notice"] { --_void-tone: var(--void-color-notice); }
126
+
127
+ /* Coloured buttons keep a tone-derived border and tint; only the
128
+ default (accent) button uses the control boundary token. The
129
+ attribute is reflected, so the default button carries
130
+ color="default". */
131
+ void-button[color]:not([color="default"]) {
132
+ --_void-tone-subtle: color-mix(in srgb, var(--_void-tone) var(--void-tone-tint), var(--void-color-control-fill));
133
+ --_void-tone-border: color-mix(in srgb, var(--_void-tone) 50%, transparent);
134
+ --_void-tone-hover: color-mix(in srgb, var(--_void-tone) calc(var(--void-tone-tint) * 1.5), var(--void-color-control-fill));
135
+ --_void-tone-active: color-mix(in srgb, var(--_void-tone) calc(var(--void-tone-tint) * 2), var(--void-color-control-fill));
136
+ }
137
+
138
+ /* A coloured ghost button carries its colour in the label, and its
139
+ hover fill is the same tint the tone uses everywhere else, so the
140
+ label keeps 4.5:1 on it. */
141
+ void-button[variant="ghost"][color]:not([color="default"]) {
142
+ --_void-tone-text: var(--_void-tone);
143
+ --_void-tone-hover: color-mix(in srgb, var(--_void-tone) var(--void-tone-tint), transparent);
144
+ --_void-tone-active: color-mix(in srgb, var(--_void-tone) calc(var(--void-tone-tint) * 1.25), transparent);
145
+ }
73
146
 
74
147
  /* Size variants */
75
148
  void-button[size="sm"] {
76
- padding: var(--void-space-1) var(--void-space-2);
77
- font-size: var(--void-text-xs);
149
+ --_void-button-height: var(--void-button-height, var(--void-control-height-sm));
150
+ --_void-button-padding: var(--void-button-padding, calc(var(--void-control-padding-sm) * 1.25));
151
+ --_void-button-font-size: var(--void-button-font-size, var(--void-control-text-sm));
78
152
  }
79
153
 
80
154
  void-button[size="lg"] {
81
- padding: var(--void-space-3) var(--void-space-6);
82
- font-size: var(--void-text-base);
83
- }
84
-
85
- void-button[size="xl"] {
86
- padding: var(--void-space-4) var(--void-space-8);
87
- font-size: var(--void-text-lg);
155
+ --_void-button-height: var(--void-button-height, var(--void-control-height-lg));
156
+ --_void-button-padding: var(--void-button-padding, calc(var(--void-control-padding-lg) * 1.25));
157
+ --_void-button-font-size: var(--void-button-font-size, var(--void-control-text-lg));
88
158
  }
89
159
 
90
- void-button[size="xxl"] {
91
- padding: var(--void-space-5) var(--void-space-10);
92
- font-size: var(--void-text-xl);
160
+ /* Icon-only: a labelled button whose only child is an icon is square. */
161
+ void-button[aria-label]:has(> svg:only-child),
162
+ void-button[aria-label]:has(> i:only-child) {
163
+ padding: 0;
164
+ min-width: var(--_void-button-height);
93
165
  }
94
166
 
95
- /* Link targets — stretch <a> to fill the full button */
96
- void-button:has(> a) {
167
+ /* Link buttons — the link (or native button) is the one control: it fills the button and carries the padding, so
168
+ the whole button is the hit area at every size, and the button draws the focus ring when it has focus. */
169
+ void-button:has(> :is(a, button)) {
97
170
  padding: 0;
98
171
  }
99
172
 
100
- void-button > a {
173
+ void-button > :is(a, button) {
101
174
  display: inline-flex;
102
175
  align-items: center;
103
176
  justify-content: center;
177
+ align-self: stretch;
104
178
  gap: var(--void-space-2);
105
- padding: var(--void-space-2) var(--void-space-4);
179
+ padding: 0 var(--_void-button-padding);
106
180
  color: inherit;
107
181
  text-decoration: none;
108
182
  flex: 1;
109
183
  }
110
184
 
111
- void-button[size="sm"] > a {
112
- padding: var(--void-space-1) var(--void-space-2);
113
- }
114
-
115
- void-button[size="lg"] > a {
116
- padding: var(--void-space-3) var(--void-space-6);
117
- }
118
-
119
- void-button[size="xl"] > a {
120
- padding: var(--void-space-4) var(--void-space-8);
185
+ void-button > :is(a, button):focus-visible {
186
+ outline: none;
121
187
  }
122
188
 
123
- void-button[size="xxl"] > a {
124
- padding: var(--void-space-5) var(--void-space-10);
189
+ /* A native button inside is bare: the host draws the button. */
190
+ void-button > button {
191
+ appearance: none;
192
+ background: none;
193
+ border: 0;
194
+ margin: 0;
195
+ font: inherit;
196
+ letter-spacing: inherit;
197
+ text-transform: inherit;
198
+ white-space: inherit;
199
+ cursor: inherit;
125
200
  }
126
201
 
127
202
  /* Disabled */
@@ -105,10 +105,20 @@ void-calendar {
105
105
  }
106
106
 
107
107
  .void-calendar-days {
108
+ display: flex;
109
+ flex-direction: column;
110
+ }
111
+
112
+ .void-calendar-week {
108
113
  display: grid;
109
114
  grid-template-columns: repeat(7, 1fr);
110
115
  }
111
116
 
117
+ .void-calendar-cell {
118
+ display: flex;
119
+ justify-content: center;
120
+ }
121
+
112
122
  .void-calendar-day {
113
123
  display: inline-flex;
114
124
  align-items: center;
@@ -132,8 +142,8 @@ void-calendar {
132
142
  }
133
143
 
134
144
  .void-calendar-day:focus-visible {
135
- outline: 2px solid var(--void-color-border-focus);
136
- outline-offset: -2px;
145
+ outline: var(--void-focus-ring-width) solid var(--void-focus-ring-color);
146
+ outline-offset: calc(-1 * var(--void-focus-ring-width));
137
147
  }
138
148
 
139
149
  .void-calendar-day.outside {
@@ -306,13 +316,19 @@ void-date-picker {
306
316
 
307
317
  .void-date-picker-input {
308
318
  width: 100%;
309
- padding: var(--void-space-2) var(--void-space-8) var(--void-space-2) var(--void-space-3);
310
- background: var(--void-color-bg-secondary);
311
- border: 1px solid var(--void-color-border);
312
- border-radius: var(--void-radius-md);
319
+ /* Room for a date beside the calendar button, which must never sit over the text. */
320
+ min-width: calc(var(--void-space-8) + 10ch);
321
+ /* A field like every other: the shared control height, the field's fill
322
+ and its 3:1 edge. It used to be drawn with the divider colour, which is
323
+ allowed to be faint, at a height and text size of its own. */
324
+ height: var(--void-control-height);
325
+ padding: 0 var(--void-space-8) 0 var(--void-control-padding);
326
+ background: var(--void-field-surface);
327
+ border: var(--void-control-border-width) solid var(--void-field-border);
328
+ border-radius: var(--void-control-radius);
313
329
  color: var(--void-color-text);
314
330
  font-family: inherit;
315
- font-size: var(--void-text-sm);
331
+ font-size: var(--void-control-text);
316
332
  line-height: var(--void-leading-normal);
317
333
  outline: none;
318
334
  cursor: pointer;
@@ -325,7 +341,7 @@ void-date-picker {
325
341
  }
326
342
 
327
343
  .void-date-picker-input:hover {
328
- border-color: var(--void-color-border-strong);
344
+ border-color: var(--void-field-border);
329
345
  }
330
346
 
331
347
  .void-date-picker-input:focus {
@@ -373,22 +389,22 @@ void-date-picker {
373
389
 
374
390
  /* ── Expanded state ── */
375
391
 
376
- void-date-picker[aria-expanded="true"] .void-date-picker-input {
392
+ void-date-picker[open] .void-date-picker-input {
377
393
  border-color: var(--void-color-border-focus);
378
394
  box-shadow: 0 0 0 1px var(--void-color-border-focus);
379
395
  }
380
396
 
381
397
  /* ── Dropdown ── */
382
398
 
399
+ /* A popover="manual" surface in the top layer; placement, flipping and
400
+ transitions are shared (overlay.css). */
383
401
  .void-date-picker-dropdown {
384
- position: absolute;
385
- top: calc(100% + var(--void-space-1));
386
- left: 0;
387
- background: var(--void-color-bg-elevated);
388
- border: 1px solid var(--void-color-border);
389
- border-radius: var(--void-radius-md);
390
- box-shadow: 0 4px 16px var(--void-color-bg-overlay);
391
- z-index: var(--void-z-dropdown);
402
+ --void-overlay-gap: var(--void-space-1);
403
+ background: var(--void-float-surface);
404
+ color: var(--void-color-text);
405
+ border: var(--void-float-border-width) solid var(--void-float-border);
406
+ border-radius: var(--void-float-radius);
407
+ box-shadow: var(--void-float-shadow);
392
408
  padding: var(--void-space-2);
393
409
  }
394
410
 
@@ -411,9 +427,16 @@ void-date-picker[color="warning"] .void-date-picker-input:focus {
411
427
  void-date-picker[color="caution"] .void-date-picker-input {
412
428
  border-color: var(--void-color-caution);
413
429
  }
430
+
431
+ void-date-picker[color="highlight"] .void-date-picker-input {
432
+ border-color: var(--void-color-highlight);
433
+ }
414
434
  void-date-picker[color="caution"] .void-date-picker-input:focus {
415
435
  box-shadow: 0 0 0 1px var(--void-color-caution);
416
436
  }
437
+ void-date-picker[color="highlight"] .void-date-picker-input:focus {
438
+ box-shadow: 0 0 0 1px var(--void-color-highlight);
439
+ }
417
440
 
418
441
  void-date-picker[color="success"] .void-date-picker-input {
419
442
  border-color: var(--void-color-success);
@@ -1,47 +1,146 @@
1
+ /* A card is a hairline and, by default, a fill you can barely see
2
+ (the chrome knob sets both). It is not a shadow: only the elevated
3
+ variant, for things that overlap the page, casts one. */
4
+ /* @tokens void-card
5
+ --void-card-surface Fill of the default card. The elevated variant takes the float role, the bordered variant has none.
6
+ --void-card-border Edge colour of the default card.
7
+ --void-card-border-width Edge thickness, every variant.
8
+ --void-card-radius Corner radius; the header, body and footer follow it.
9
+ --void-card-shadow Shadow of the default card.
10
+ --void-card-padding Padding of the header (inline), the body and the footer (inline). Applies whatever the padding attribute says, except padding="none". */
11
+
1
12
  void-card {
13
+ --_void-card-padding: var(--void-card-padding, var(--void-container-padding));
14
+
2
15
  display: flex;
3
16
  flex-direction: column;
4
- border: 1px solid var(--void-color-border);
5
- border-radius: var(--void-radius-lg);
6
- overflow: auto;
7
- background: var(--void-color-bg-secondary);
17
+ --_void-card-radius: var(--void-card-radius, var(--void-container-radius));
18
+ --_void-card-border-width: var(--void-card-border-width, var(--void-container-border-width));
19
+ border: var(--_void-card-border-width) solid var(--void-card-border, var(--void-container-border));
20
+ border-radius: var(--_void-card-radius);
21
+ /* visible: the card is neither a scroll container (its automatic minimum
22
+ size stays content-based, so flex parents cannot shrink it) nor a clip
23
+ (dropdowns, popovers, tooltips and calendars may extend past its edge).
24
+ The header and body carry the corner radii instead. Opt in to scrolling
25
+ with [scrollable]. */
26
+ overflow: visible;
27
+ --_void-card-inner-radius: max(0px, calc(var(--_void-card-radius) - var(--_void-card-border-width)));
28
+ background: var(--void-card-surface, var(--void-container-surface));
29
+ box-shadow: var(--void-card-shadow, var(--void-container-shadow));
8
30
  font-family: var(--void-font-sans);
9
31
  }
10
32
 
33
+ void-card[scrollable] {
34
+ overflow: auto;
35
+ min-height: 0;
36
+ }
37
+
11
38
  void-card[variant="elevated"] {
12
- background: var(--void-color-bg-elevated);
13
- border: none;
14
- box-shadow: var(--void-shadow-md);
39
+ background: var(--void-float-surface);
40
+ border-color: var(--void-float-border);
41
+ box-shadow: var(--void-float-shadow);
15
42
  }
16
43
 
17
- void-card[variant="outlined"] {
44
+ /* No fill and no shadow: only a line, the frame rule (a skin's container
45
+ edge may be invisible, and a bordered card is nothing but its edge). */
46
+ void-card[variant="bordered"] {
18
47
  background: transparent;
19
- border: 1px solid var(--void-color-border);
48
+ border: var(--void-rule-frame);
49
+ box-shadow: none;
50
+ }
51
+
52
+ /* Parts (CSS-only): header (title, description, anything at its far end),
53
+ body, footer. The card renders nothing itself. */
54
+ void-card-header {
55
+ display: flex;
56
+ flex-wrap: wrap;
57
+ align-items: baseline;
58
+ /* The header is as tall as a large control (44px by default), rule
59
+ included, and its lines sit in the middle of it. A header with only a
60
+ title, one with a badge and one with a small button are then the same
61
+ height, where each used to be as tall as its tallest child plus padding. */
62
+ align-content: center;
63
+ min-height: var(--void-control-height-lg);
64
+ column-gap: var(--void-space-3);
65
+ row-gap: var(--void-space-1);
66
+ border-radius: var(--_void-card-inner-radius) var(--_void-card-inner-radius) 0 0;
67
+ padding: var(--void-space-2) var(--_void-card-padding);
68
+ border-bottom: var(--void-rule-head);
69
+ }
70
+
71
+ void-card-title {
72
+ font-family: var(--void-type-heading-family);
73
+ font-size: var(--void-type-body-size);
74
+ line-height: var(--void-type-heading-leading);
75
+ font-weight: var(--void-type-heading-weight);
76
+ letter-spacing: var(--void-type-heading-tracking);
77
+ color: var(--void-type-heading-color);
78
+ }
79
+
80
+ /* Whatever follows the title and description (a badge, void-actions) sits at the far end. */
81
+ void-card-header > :not(void-card-title, void-card-description):first-of-type {
82
+ margin-inline-start: auto;
83
+ }
84
+
85
+ void-card-description {
86
+ flex-basis: 100%;
87
+ font-size: var(--void-type-caption-size);
88
+ color: var(--void-color-text-secondary);
89
+ }
90
+
91
+ void-card-body {
92
+ display: block;
93
+ padding: var(--_void-card-padding);
94
+ }
95
+
96
+ /* Blocks written straight into the body (a paragraph, then a field) sit a
97
+ step apart. The scoped reset removes every margin, so without this a label
98
+ sat directly under the sentence above it. Only block-level content is
99
+ named: text with inline markup, and a row of buttons, are left alone. For
100
+ another rhythm, wrap the content in void-stack. */
101
+ void-card-body > :where(p, ul, ol, dl, pre, blockquote, form, fieldset, table, figure, div, section, h2, h3, h4, h5, h6, void-field, void-stack, void-alert, void-banner, void-rows, void-description-list, void-checkbox-group, void-radio-group, void-table, void-card, void-panel, void-list, void-divider, void-figures, void-split, void-input, void-textarea, void-select, void-combobox, void-progress) + :where(p, ul, ol, dl, pre, blockquote, form, fieldset, table, figure, div, section, h2, h3, h4, h5, h6, void-field, void-stack, void-alert, void-banner, void-rows, void-description-list, void-checkbox-group, void-radio-group, void-table, void-card, void-panel, void-list, void-divider, void-figures, void-split, void-input, void-textarea, void-select, void-combobox, void-progress) {
102
+ margin-block-start: var(--void-gap-inside);
103
+ }
104
+
105
+ void-card-footer {
106
+ display: flex;
107
+ flex-wrap: wrap;
108
+ align-items: center;
109
+ gap: var(--void-space-2);
110
+ padding: var(--void-space-3) var(--_void-card-padding);
111
+ border-top: var(--void-rule-between);
112
+ }
113
+
114
+ /* The first part takes the top corners, the last the bottom ones. */
115
+ void-card > :first-child {
116
+ border-top-left-radius: var(--_void-card-inner-radius);
117
+ border-top-right-radius: var(--_void-card-inner-radius);
20
118
  }
21
119
 
22
- .void-card-header {
23
- padding: var(--void-space-4) var(--void-space-4) var(--void-space-3);
24
- border-bottom: 1px solid var(--void-color-border);
120
+ void-card > :last-child {
121
+ border-bottom-left-radius: var(--_void-card-inner-radius);
122
+ border-bottom-right-radius: var(--_void-card-inner-radius);
25
123
  }
26
124
 
27
- .void-card-heading {
28
- font-size: var(--void-text-base);
29
- font-weight: var(--void-weight-semibold);
30
- color: var(--void-color-text);
125
+ /* Edge-to-edge media: the first and last child follow the body's corners. */
126
+ void-card[padding="none"] > void-card-body > :first-child {
127
+ border-top-left-radius: inherit;
128
+ border-top-right-radius: inherit;
31
129
  }
32
130
 
33
- .void-card-body {
34
- padding: var(--void-space-4);
131
+ void-card[padding="none"] > void-card-body > :last-child {
132
+ border-bottom-left-radius: inherit;
133
+ border-bottom-right-radius: inherit;
35
134
  }
36
135
 
37
- void-card[padding="none"] .void-card-body {
136
+ void-card[padding="none"] > void-card-body {
38
137
  padding: 0;
39
138
  }
40
139
 
41
- void-card[padding="sm"] .void-card-body {
42
- padding: var(--void-space-2);
140
+ void-card[padding="sm"] {
141
+ --_void-card-padding: var(--void-card-padding, var(--void-space-3));
43
142
  }
44
143
 
45
- void-card[padding="lg"] .void-card-body {
46
- padding: var(--void-space-6);
144
+ void-card[padding="lg"] {
145
+ --_void-card-padding: var(--void-card-padding, var(--void-space-8));
47
146
  }