@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
@@ -0,0 +1,348 @@
1
+ /* @tokens void-page-head
2
+ --void-page-head-rule The line under the page head.
3
+ --void-page-head-padding Space between the head's text and that line. */
4
+
5
+ /* @tokens void-page
6
+ --void-page-actions-surface Fill of the actions that close a page or its form (void-actions directly in void-page, or in the form that wraps its sections). Unset, they sit on the page.
7
+ --void-page-actions-padding-block Padding above and below those actions.
8
+ --void-page-actions-padding-inline Padding at their two ends.
9
+ --void-page-actions-radius Corner radius of their box.
10
+ --void-page-actions-shadow Shadow of their box.
11
+ --void-page-actions-border Edge colour of their box.
12
+ --void-page-actions-border-width Edge thickness of their box; 0 by default. Set it (the colour may be transparent) whenever the box has a fill or a shadow: forced colours removes both, and the edge is what remains. */
13
+
14
+ /* @tokens void-section
15
+ --void-section-surface Fill of a titled section (one with a heading, or one that holds a table). Unset, a section draws nothing.
16
+ --void-section-border Edge colour of a titled section.
17
+ --void-section-border-width Edge thickness of a titled section; 0 by default. Set it (the colour may be transparent) whenever the section has a fill or a shadow: forced colours removes both, and the edge is what remains.
18
+ --void-section-radius Corner radius of a titled section.
19
+ --void-section-shadow Shadow of a titled section.
20
+ --void-section-padding Padding inside a titled section.
21
+ --void-section-rule The line under the head of a `divided` section. */
22
+
23
+ /* The patterns style the native elements placed inside them (h1, h2,
24
+ p, dl). Their browser margins are removed here, so the patterns do
25
+ not depend on the theme's reset being loaded. */
26
+ :where(void-page-head, void-section, void-section-head, void-empty, void-media-content, void-stack, void-row-text, void-figure, void-glass) > :where(h1, h2, h3, h4, p),
27
+ :where(void-description-list) :where(dl, dt, dd) {
28
+ margin: 0;
29
+ }
30
+
31
+ /* ── void-page: the content column ──
32
+ One centred column with a gutter that tightens on narrow screens.
33
+ Blocks inside it sit a group apart; sections sit a section apart.
34
+
35
+ <main>
36
+ <void-page>
37
+ <void-page-head>…</void-page-head>
38
+ <void-section>…</void-section>
39
+ <void-section>…</void-section>
40
+ </void-page>
41
+ </main>
42
+
43
+ width="narrow" is for forms and reading; "wide" and "full" for
44
+ dense tables and dashboards. */
45
+ void-page {
46
+ --_void-page-width: var(--void-measure-page);
47
+
48
+ display: flex;
49
+ flex-direction: column;
50
+ gap: var(--void-gap-group);
51
+ box-sizing: border-box;
52
+ width: 100%;
53
+ max-width: var(--_void-page-width);
54
+ margin-inline: auto;
55
+ padding: var(--void-gap-group) var(--void-gutter) var(--void-gap-section);
56
+ }
57
+
58
+ void-page[width="narrow"] { --_void-page-width: calc(var(--void-measure) * 1.25 + 2 * var(--void-gutter)); }
59
+ void-page[width="wide"] { --_void-page-width: calc(var(--void-measure-page) * 1.3334); }
60
+ void-page[width="full"] { --_void-page-width: none; }
61
+
62
+ void-page > * {
63
+ min-width: 0;
64
+ }
65
+
66
+ /* A new section gets the larger gap; the head, an alert and the first
67
+ block under them stay a group apart. */
68
+ :is(void-page, void-page > form) > :is(void-section, void-split) + :is(void-section, void-split) {
69
+ margin-top: calc(var(--void-gap-section) - var(--void-gap-group));
70
+ }
71
+
72
+ /* A form that wraps the page's sections keeps the page's rhythm. */
73
+ void-page > form {
74
+ display: flex;
75
+ flex-direction: column;
76
+ gap: var(--void-gap-group);
77
+ }
78
+
79
+ /* The actions that close a page or its form (Cancel, Save) are a block of
80
+ the page like its sections. Where sections are boxes, a skin can make
81
+ them one too: a bar of its own, so they do not float under the last box
82
+ and outside every one. Unset, the tokens draw nothing. */
83
+ :is(void-page, void-page > form) > void-actions {
84
+ padding: var(--void-page-actions-padding-block, 0) var(--void-page-actions-padding-inline, 0);
85
+ border: var(--void-page-actions-border-width, 0) solid var(--void-page-actions-border, transparent);
86
+ border-radius: var(--void-page-actions-radius, 0);
87
+ background: var(--void-page-actions-surface, transparent);
88
+ box-shadow: var(--void-page-actions-shadow, none);
89
+ }
90
+
91
+ /* ── void-page-head: what this page is and what you can do here ──
92
+ <void-page-head>
93
+ <void-breadcrumbs>…</void-breadcrumbs> or a label
94
+ <h1>Ground network</h1>
95
+ <p>One sentence about the page.</p>
96
+ <void-actions>…buttons…</void-actions>
97
+ </void-page-head>
98
+ The text stacks on the left; the actions sit at the bottom right,
99
+ on the title's line, and drop under the text when there is no room. */
100
+ void-page-head {
101
+ display: grid;
102
+ grid-template-columns: minmax(0, 1fr) auto;
103
+ column-gap: var(--void-gap-inside);
104
+ align-items: end;
105
+ padding-bottom: var(--void-page-head-padding, var(--void-gap-inside));
106
+ border-bottom: var(--void-page-head-rule, var(--void-rule-head));
107
+ }
108
+
109
+ void-page-head > * {
110
+ grid-column: 1;
111
+ min-width: 0;
112
+ }
113
+
114
+ void-page-head > :not(void-actions) + :not(void-actions) {
115
+ margin-top: var(--void-gap-tight);
116
+ }
117
+
118
+ void-page-head > h1 {
119
+ font-family: var(--void-type-title-family);
120
+ font-size: var(--void-type-title-size);
121
+ line-height: var(--void-type-title-leading);
122
+ font-weight: var(--void-type-title-weight);
123
+ letter-spacing: var(--void-type-title-tracking);
124
+ color: var(--void-type-title-color);
125
+ }
126
+
127
+ void-page-head > p {
128
+ max-width: var(--void-measure);
129
+ font-size: var(--void-type-body-size);
130
+ line-height: var(--void-type-body-leading);
131
+ color: var(--void-color-text-secondary);
132
+ }
133
+
134
+ void-page-head > void-actions {
135
+ grid-column: 2;
136
+ grid-row: 1 / span 4;
137
+ align-self: end;
138
+ }
139
+
140
+ /* No rule under the head: for a page whose first block draws its own. */
141
+ void-page-head[flush] {
142
+ padding-bottom: 0;
143
+ border-bottom: 0;
144
+ }
145
+
146
+ /* ── void-actions: a row of buttons ── */
147
+ void-actions {
148
+ display: flex;
149
+ align-items: center;
150
+ flex-wrap: wrap;
151
+ gap: var(--void-gap-tight);
152
+ }
153
+
154
+ /* `align` is a legacy HTML attribute that browsers still act on (it
155
+ sets text-align), so these elements use other names. */
156
+ void-actions[justify="end"] { justify-content: flex-end; }
157
+ void-actions[justify="center"] { justify-content: center; }
158
+
159
+ /* In a table row: ghost buttons at the end of the row, their labels (not
160
+ their padding) on the table's edge. These sit with the pattern, not in
161
+ table.css: a pattern layer rule beats a component layer rule whatever
162
+ its specificity, so the table context has to be in the pattern's layer. */
163
+ void-table td > void-actions {
164
+ flex-wrap: nowrap;
165
+ gap: var(--void-space-1);
166
+ }
167
+
168
+ void-table td:last-child > void-actions {
169
+ justify-content: flex-end;
170
+ }
171
+
172
+ void-table:not([inset]) td:last-child > void-actions:has(> void-button[variant="ghost"]:last-child) {
173
+ margin-inline-end: calc(var(--void-control-padding-sm) * -1.25);
174
+ }
175
+
176
+ /* ── void-section: a titled part of a page ──
177
+ <void-section>
178
+ <void-section-head>
179
+ <h2>Upcoming passes</h2>
180
+ <p>Optional description.</p>
181
+ <span data-void-type="label">Next 6 hours</span> an aside:
182
+ </void-section-head> label, or
183
+ …content… void-actions
184
+ </void-section>
185
+ No box and no shadow: the heading, then the content. `divided`
186
+ draws a hairline under the head for content that has no line of
187
+ its own (a form, a paragraph, a chart). */
188
+ void-section {
189
+ display: flex;
190
+ flex-direction: column;
191
+ gap: var(--void-gap-inside);
192
+ min-width: 0;
193
+ }
194
+
195
+ void-section > * {
196
+ min-width: 0;
197
+ }
198
+
199
+ /* A titled section, or one that holds a table, can be drawn as a box:
200
+ the section tokens apply to it and to nothing else. A bare section (a
201
+ row of figures, an alert) stays a layout group, so its contents are
202
+ never boxed twice. Unset, the tokens draw nothing. */
203
+ void-section:has(> :is(void-section-head, h2, h3, h4, void-table)) {
204
+ padding: var(--void-section-padding, 0);
205
+ border: var(--void-section-border-width, 0) solid var(--void-section-border, transparent);
206
+ border-radius: var(--void-section-radius, 0);
207
+ background: var(--void-section-surface, transparent);
208
+ box-shadow: var(--void-section-shadow, none);
209
+ /* What a table inside paints its sticky cells with. */
210
+ --_void-under: var(--void-section-surface);
211
+ }
212
+
213
+ /* Forced colours removes fills and shadows: where a skin has made the page
214
+ actions or a section a box, its edge is the boundary that is left, drawn
215
+ in a system colour whatever colour the skin gave it (forced-colors.css
216
+ has the same for the container components). With no edge thickness set,
217
+ as by default, nothing is drawn. */
218
+ @media (forced-colors: active) {
219
+ :is(void-page, void-page > form) > void-actions,
220
+ void-section:has(> :is(void-section-head, h2, h3, h4, void-table)) {
221
+ border-color: CanvasText;
222
+ }
223
+ }
224
+
225
+ void-section-head {
226
+ display: grid;
227
+ grid-template-columns: minmax(0, 1fr) auto;
228
+ column-gap: var(--void-gap-inside);
229
+ align-items: baseline;
230
+ }
231
+
232
+ void-section-head > * {
233
+ grid-column: 1;
234
+ min-width: 0;
235
+ }
236
+
237
+ void-section > :is(h2, h3, h4),
238
+ void-section-head > :is(h2, h3, h4) {
239
+ font-family: var(--void-type-heading-family);
240
+ font-size: var(--void-type-heading-size);
241
+ line-height: var(--void-type-heading-leading);
242
+ font-weight: var(--void-type-heading-weight);
243
+ letter-spacing: var(--void-type-heading-tracking);
244
+ color: var(--void-type-heading-color);
245
+ }
246
+
247
+ void-section-head > p {
248
+ margin-top: var(--void-space-1);
249
+ max-width: var(--void-measure);
250
+ font-size: var(--void-type-body-size);
251
+ line-height: var(--void-type-body-leading);
252
+ color: var(--void-color-text-secondary);
253
+ }
254
+
255
+ /* The aside: anything that is not the heading or its description. */
256
+ void-section-head > :not(h2, h3, h4, p) {
257
+ grid-column: 2;
258
+ grid-row: 1 / span 2;
259
+ align-self: baseline;
260
+ }
261
+
262
+ void-section-head > void-actions {
263
+ align-self: center;
264
+ }
265
+
266
+ void-section[divided] > void-section-head {
267
+ padding-bottom: var(--void-gap-inside);
268
+ border-bottom: var(--void-section-rule, var(--void-rule-head));
269
+ }
270
+
271
+ /* A section whose content is several blocks (the groups of a form). */
272
+ void-section[gap="stack"] { gap: var(--void-gap-stack); }
273
+ void-section[gap="group"] { gap: var(--void-gap-group); }
274
+
275
+ /* ── void-split: columns that collapse to one ──
276
+ <void-split ratio="2:1">…two children…</void-split>
277
+ ratio: 1:1 (default), 2:1, 1:2, and "aside" for a narrow fixed
278
+ column beside the content (a settings list, a filter panel). */
279
+ void-split {
280
+ display: grid;
281
+ grid-template-columns: repeat(2, minmax(0, 1fr));
282
+ gap: var(--void-gap-group);
283
+ align-items: start;
284
+ }
285
+
286
+ void-split[ratio="2:1"] { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
287
+ void-split[ratio="1:2"] { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
288
+ void-split[ratio="aside"] { grid-template-columns: 12rem minmax(0, 1fr); }
289
+ void-split[valign="center"] { align-items: center; }
290
+ void-split[valign="end"] { align-items: end; }
291
+
292
+ void-split > * {
293
+ min-width: 0;
294
+ }
295
+
296
+ /* A column of sections inside a split keeps the section rhythm. */
297
+ void-stack {
298
+ display: flex;
299
+ flex-direction: column;
300
+ gap: var(--void-gap-inside);
301
+ min-width: 0;
302
+ }
303
+
304
+ void-stack[gap="tight"] { gap: var(--void-gap-tight); }
305
+ void-stack[gap="stack"] { gap: var(--void-gap-stack); }
306
+ void-stack[gap="group"] { gap: var(--void-gap-group); }
307
+ void-stack[gap="section"] { gap: var(--void-gap-section); }
308
+
309
+ /* Stays in view while the column beside it scrolls. */
310
+ void-split > [sticky] {
311
+ position: sticky;
312
+ top: var(--void-gap-group);
313
+ }
314
+
315
+ @media (max-width: 48rem) {
316
+ /* One action stays beside the title; several drop under the text. */
317
+ void-page-head > void-actions:has(> :nth-child(2)) {
318
+ grid-column: 1 / -1;
319
+ grid-row: auto;
320
+ margin-top: var(--void-gap-inside);
321
+ }
322
+
323
+ void-split,
324
+ void-split[ratio] {
325
+ grid-template-columns: minmax(0, 1fr);
326
+ }
327
+
328
+ void-split > [sticky] {
329
+ position: static;
330
+ }
331
+ }
332
+
333
+ @media (max-width: 30rem) {
334
+ /* An aside that is a row of buttons drops under the heading. */
335
+ void-section-head > void-actions {
336
+ grid-column: 1;
337
+ grid-row: auto;
338
+ margin-top: var(--void-gap-tight);
339
+ }
340
+ }
341
+
342
+ /* Anchored overlays keep the width of their trigger. They are inline
343
+ by default, but a flex or grid parent (a section, a stack, a row)
344
+ would stretch them, and the panel would then be placed against the
345
+ stretched box instead of the trigger. */
346
+ :is(void-tooltip, void-hover-card, void-popover, void-dropdown-menu) {
347
+ width: fit-content;
348
+ }