@voidable/theme 0.6.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.
- package/README.md +133 -8
- package/package.json +66 -8
- package/src/app-shell/detail.css +7 -5
- package/src/app-shell/subtable.css +7 -6
- package/src/base.css +28 -0
- package/src/components/accordion.css +96 -19
- package/src/components/action-input.css +51 -61
- package/src/components/alert.css +63 -23
- package/src/components/avatar.css +0 -2
- package/src/components/badge.css +35 -25
- package/src/components/banner.css +60 -19
- package/src/components/bar-chart.css +75 -0
- package/src/components/breadcrumbs.css +20 -16
- package/src/components/button.css +130 -55
- package/src/components/calendar.css +40 -17
- package/src/components/card.css +122 -23
- package/src/components/carousel.css +85 -118
- package/src/components/checkbox-group.css +3 -1
- package/src/components/checkbox.css +18 -23
- package/src/components/collapsible.css +95 -29
- package/src/components/color-picker.css +10 -10
- package/src/components/combobox.css +47 -29
- package/src/components/compose-input.css +3 -3
- package/src/components/dialog.css +115 -41
- package/src/components/divider.css +7 -4
- package/src/components/donut-chart.css +105 -0
- package/src/components/drawer.css +135 -68
- package/src/components/dropdown-menu.css +21 -43
- package/src/components/editable.css +7 -7
- package/src/components/error-fallback.css +48 -27
- package/src/components/field.css +12 -5
- package/src/components/file-upload.css +2 -1
- package/src/components/gauge.css +194 -0
- package/src/components/hamburger.css +10 -10
- package/src/components/hover-card.css +13 -113
- package/src/components/indicator.css +22 -18
- package/src/components/input.css +15 -12
- package/src/components/line-chart.css +137 -0
- package/src/components/list.css +28 -7
- package/src/components/menu.css +48 -33
- package/src/components/multiselect.css +57 -40
- package/src/components/nav-bar.css +23 -14
- package/src/components/nav-menu.css +31 -22
- package/src/components/number-input.css +85 -62
- package/src/components/overlay.css +215 -0
- package/src/components/pagination.css +42 -31
- package/src/components/panel.css +37 -11
- package/src/components/pin-input.css +23 -22
- package/src/components/popover.css +19 -35
- package/src/components/progress.css +19 -10
- package/src/components/radio-group.css +2 -1
- package/src/components/radio.css +15 -20
- package/src/components/scroll-area.css +3 -3
- package/src/components/segmented-control.css +46 -29
- package/src/components/select.css +99 -31
- package/src/components/sidebar.css +8 -4
- package/src/components/skeleton.css +8 -3
- package/src/components/slider.css +4 -2
- package/src/components/spinner.css +5 -4
- package/src/components/stat.css +59 -52
- package/src/components/status-dot.css +0 -1
- package/src/components/switch.css +18 -26
- package/src/components/table.css +443 -16
- package/src/components/tabs.css +92 -29
- package/src/components/tag.css +44 -20
- package/src/components/tags-input.css +43 -55
- package/src/components/textarea.css +15 -12
- package/src/components/toast.css +84 -22
- package/src/components/toggle.css +35 -42
- package/src/components/tooltip.css +19 -38
- package/src/core.css +98 -0
- package/src/forced-colors.css +134 -0
- package/src/index.css +4 -71
- package/src/knobs.css +101 -0
- package/src/layers.css +38 -0
- package/src/media/media.css +258 -0
- package/src/media/surface.css +143 -0
- package/src/patterns/data.css +461 -0
- package/src/patterns/page.css +348 -0
- package/src/patterns/shell.css +371 -0
- package/src/pre-upgrade.css +202 -0
- package/src/primitives.css +44 -71
- package/src/reset.css +45 -21
- package/src/skins/loft.css +114 -0
- package/src/skins/slab.css +107 -0
- package/src/themes/aurora.css +16 -0
- package/src/themes/capsule.css +16 -0
- package/src/themes/console.css +16 -0
- package/src/themes/dune.css +16 -0
- package/src/themes/iris.css +16 -0
- package/src/themes/orbit.css +16 -0
- package/src/themes/paper.css +18 -0
- package/src/themes/void.css +16 -0
- package/src/tokens.css +552 -98
- package/src/type.css +103 -0
package/src/components/table.css
CHANGED
|
@@ -1,46 +1,473 @@
|
|
|
1
|
+
/* ============================================================
|
|
2
|
+
void-table: a native <table> that sits on the page.
|
|
3
|
+
|
|
4
|
+
Its tokens are listed below. A token set on any ancestor, on :root or
|
|
5
|
+
on the table itself applies; --void-table-max-height and, for
|
|
6
|
+
stack="30rem", --void-table-stack-at are set by the component.
|
|
7
|
+
============================================================ */
|
|
8
|
+
|
|
9
|
+
/* @tokens void-table
|
|
10
|
+
--void-table-rule The line between rows; with `bordered`, the grid is the --void-rule role.
|
|
11
|
+
--void-table-rule-head The line under the header row.
|
|
12
|
+
--void-table-rule-edge The line under the last row.
|
|
13
|
+
--void-table-surface What sticky cells are painted with: what the table sits on. A boxed section and `inset` set it for you.
|
|
14
|
+
--void-table-padding-block Block padding of a cell (follows --void-density; `compact` has its own).
|
|
15
|
+
--void-table-padding-inline Inline padding of a cell.
|
|
16
|
+
--void-table-edge Setting: padding at the table's first and last column.
|
|
17
|
+
--void-table-stack-at Setting: container width below which [stack] stacks.
|
|
18
|
+
--void-table-tile Setting: least width of one label and value pair when stacked.
|
|
19
|
+
--void-table-row-size Setting: height assumed for a stacked row of a long table that is out of view.
|
|
20
|
+
--void-table-fade Setting: width of the scroll-edge fade.
|
|
21
|
+
--void-table-sticky-top Setting: offset of a sticky header from the top. */
|
|
22
|
+
|
|
1
23
|
void-table {
|
|
24
|
+
--_void-table-padding-block: var(--void-table-padding-block, var(--void-cell-padding-block));
|
|
25
|
+
--_void-table-padding-inline: var(--void-table-padding-inline, var(--void-cell-padding-inline));
|
|
26
|
+
--_void-table-edge: var(--void-table-edge, 0);
|
|
27
|
+
--_void-table-surface: var(--void-table-surface, var(--_void-under, var(--void-color-bg)));
|
|
28
|
+
--_void-table-stack-at: var(--void-table-stack-at, 40rem);
|
|
29
|
+
--_void-table-tile: var(--void-table-tile, 9rem);
|
|
30
|
+
--_void-table-row-size: var(--void-table-row-size, 12rem);
|
|
31
|
+
--_void-table-fade: var(--void-table-fade, var(--void-space-8));
|
|
32
|
+
--_void-table-sticky-top: var(--void-table-sticky-top, 0);
|
|
33
|
+
--void-table-max-height: none;
|
|
34
|
+
--_void-table-row-rule: var(--void-table-rule, var(--void-rule-between));
|
|
35
|
+
|
|
36
|
+
/* visible: nothing here clips a menu, popover or tooltip opened from a cell.
|
|
37
|
+
Scrolling is opt-in with [scrollable]. */
|
|
2
38
|
display: block;
|
|
3
39
|
font-family: var(--void-font-sans);
|
|
4
|
-
overflow-x: auto;
|
|
5
40
|
}
|
|
6
41
|
|
|
7
42
|
void-table table {
|
|
8
43
|
width: 100%;
|
|
9
44
|
border-collapse: collapse;
|
|
10
|
-
font-size: var(--void-
|
|
45
|
+
font-size: var(--void-type-body-size);
|
|
46
|
+
/* Digits line up down a column without any per-cell markup. */
|
|
47
|
+
font-variant-numeric: tabular-nums;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* A caption names the table; quiet, above it. */
|
|
51
|
+
void-table caption {
|
|
52
|
+
caption-side: top;
|
|
53
|
+
text-align: start;
|
|
54
|
+
font-family: var(--void-type-label-family);
|
|
55
|
+
font-size: var(--void-type-label-size);
|
|
56
|
+
line-height: var(--void-type-label-leading);
|
|
57
|
+
letter-spacing: var(--void-type-label-tracking);
|
|
58
|
+
text-transform: var(--void-type-label-case);
|
|
59
|
+
color: var(--void-type-label-color);
|
|
60
|
+
padding-block-end: var(--void-space-2);
|
|
11
61
|
}
|
|
12
62
|
|
|
63
|
+
/* Header cells are labels: the small quiet name of a column. */
|
|
13
64
|
void-table th {
|
|
65
|
+
vertical-align: middle;
|
|
14
66
|
text-align: left;
|
|
15
|
-
font-
|
|
16
|
-
font-size: var(--void-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
67
|
+
font-family: var(--void-type-label-family);
|
|
68
|
+
font-size: var(--void-type-label-size);
|
|
69
|
+
line-height: var(--void-type-label-leading);
|
|
70
|
+
font-weight: var(--void-type-label-weight);
|
|
71
|
+
letter-spacing: var(--void-type-label-tracking);
|
|
72
|
+
text-transform: var(--void-type-label-case);
|
|
73
|
+
color: var(--void-type-label-color);
|
|
74
|
+
white-space: nowrap;
|
|
75
|
+
padding: var(--void-space-2) var(--_void-table-padding-inline);
|
|
76
|
+
border-bottom: var(--void-table-rule-head, var(--void-rule-head));
|
|
22
77
|
}
|
|
23
78
|
|
|
24
79
|
void-table td {
|
|
25
|
-
|
|
80
|
+
/* Stated, not left to the browser default, so a reset that sets
|
|
81
|
+
vertical-align: baseline on cells does not shift every row. */
|
|
82
|
+
vertical-align: middle;
|
|
83
|
+
padding: var(--_void-table-padding-block) var(--_void-table-padding-inline);
|
|
26
84
|
color: var(--void-color-text);
|
|
27
|
-
border-bottom:
|
|
85
|
+
border-bottom: var(--_void-table-row-rule);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* The last row closes the table: its line is the edge rule, which a skin
|
|
89
|
+
can switch off where the table sits in a box that has an edge of its own. */
|
|
90
|
+
void-table:not([bordered]) table > :is(tbody, tfoot):last-child > tr:last-child {
|
|
91
|
+
--_void-table-row-rule: var(--void-table-rule-edge, var(--void-rule-edge));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* A plain table sits on the page: its first and last columns align with the
|
|
95
|
+
content edge instead of being inset from it (--void-table-edge is 0).
|
|
96
|
+
Tables that paint rows or cells (striped, hoverable, bordered) keep the
|
|
97
|
+
inset, and an [inset] table pads to its container's content edge. */
|
|
98
|
+
void-table:is([striped], [hoverable], [bordered]) {
|
|
99
|
+
--_void-table-edge: var(--void-table-edge, var(--_void-table-padding-inline));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
void-table :is(th, td):first-child {
|
|
103
|
+
padding-inline-start: var(--_void-table-edge);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
void-table :is(th, td):last-child {
|
|
107
|
+
padding-inline-end: var(--_void-table-edge);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Numeric columns: data-align="end" on the header cell (copied to the cells
|
|
111
|
+
by the component) or on any cell. */
|
|
112
|
+
void-table [data-align="end"] {
|
|
113
|
+
text-align: end;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
void-table [data-align="center"] {
|
|
117
|
+
text-align: center;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* data-numeric is the short form of data-align="end" for a column of numbers:
|
|
121
|
+
mark the header and the cells (the page patterns write it by hand). */
|
|
122
|
+
void-table :is(th, td)[data-numeric] {
|
|
123
|
+
text-align: end;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* A column of row actions: ghost buttons, end-aligned, their labels
|
|
127
|
+
(not their padding) on the table's edge. */
|
|
128
|
+
void-table :is(th, td)[data-stack="actions"] {
|
|
129
|
+
text-align: end;
|
|
130
|
+
white-space: nowrap;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
void-table td[data-stack="actions"] > * + * {
|
|
134
|
+
margin-inline-start: var(--void-space-1);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
void-table td[data-stack="actions"]:last-child > :last-child {
|
|
138
|
+
margin-inline-end: calc(var(--void-control-padding-sm) * -1.25);
|
|
28
139
|
}
|
|
29
140
|
|
|
30
141
|
void-table[striped] tbody tr:nth-child(even) {
|
|
31
142
|
background: var(--void-color-bg-secondary);
|
|
32
143
|
}
|
|
33
144
|
|
|
145
|
+
void-table[hoverable] tbody tr {
|
|
146
|
+
transition: background var(--void-duration-fast) var(--void-ease-in-out);
|
|
147
|
+
}
|
|
148
|
+
|
|
34
149
|
void-table[hoverable] tbody tr:hover {
|
|
35
|
-
background: var(--void-color-bg-
|
|
150
|
+
background: var(--void-color-bg-secondary);
|
|
36
151
|
}
|
|
37
152
|
|
|
38
|
-
void-table[compact]
|
|
39
|
-
void-table
|
|
40
|
-
padding: var(--void-space-2);
|
|
153
|
+
void-table[compact] {
|
|
154
|
+
--_void-table-padding-block: var(--void-table-padding-block, var(--void-space-1h));
|
|
155
|
+
--_void-table-padding-inline: var(--void-table-padding-inline, var(--void-space-2));
|
|
41
156
|
}
|
|
42
157
|
|
|
43
158
|
void-table[bordered] th,
|
|
44
159
|
void-table[bordered] td {
|
|
45
|
-
border:
|
|
160
|
+
border: var(--void-rule);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* The grid is thin lines; the line under the header and the frame round the
|
|
164
|
+
whole table are the head and frame rules, so a skin with heavy rules
|
|
165
|
+
draws them heavy (borders collapse, and the wider line wins). */
|
|
166
|
+
void-table[bordered] th {
|
|
167
|
+
border-bottom: var(--void-table-rule-head, var(--void-rule-head));
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
void-table[bordered] table {
|
|
171
|
+
border: var(--void-rule-frame);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* ── Inset: a table inside a card or panel ──
|
|
175
|
+
The table bleeds out of the container's padding, so dividers, stripes and
|
|
176
|
+
the hover fill run to the container's edge, and its columns pad back in by
|
|
177
|
+
the same amount, so text stays on the container's content edge. */
|
|
178
|
+
void-table[inset] {
|
|
179
|
+
--_void-table-inset: var(--_void-card-padding, var(--void-container-padding));
|
|
180
|
+
--_void-table-edge: var(--void-table-edge, var(--_void-table-inset));
|
|
181
|
+
--_void-table-surface: var(--void-table-surface, var(--void-color-surface));
|
|
182
|
+
|
|
183
|
+
margin-inline: calc(var(--_void-table-inset) * -1);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* ── Scroll region ──
|
|
187
|
+
The host is the region: [scrollable] clips sideways and scrolls. The
|
|
188
|
+
component makes it focusable and named only while it really overflows, and
|
|
189
|
+
reports more-to-scroll-to with data-overflow-start / -end. */
|
|
190
|
+
void-table[scrollable] {
|
|
191
|
+
overflow-x: auto;
|
|
192
|
+
overflow-y: hidden;
|
|
193
|
+
scrollbar-width: thin;
|
|
194
|
+
scrollbar-color: var(--void-color-border-strong) transparent;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
void-table[scrollable][max-height] {
|
|
198
|
+
overflow-y: auto;
|
|
199
|
+
max-height: var(--void-table-max-height);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
void-table[scrollable]:focus-visible {
|
|
203
|
+
outline: var(--void-focus-ring-width) solid var(--void-focus-ring-color);
|
|
204
|
+
outline-offset: calc(var(--void-focus-ring-width) * -1);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* The fade would clip the focus ring: while focused, the ring is the cue. */
|
|
208
|
+
void-table[scrollable]:focus-visible {
|
|
209
|
+
mask-image: none !important;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* Cells stay on one line: a region that scrolls is for tables wider than it. */
|
|
213
|
+
void-table[scrollable] :is(th, td) {
|
|
214
|
+
white-space: nowrap;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* Edge fades: the content dissolves where there is more to scroll to. */
|
|
218
|
+
void-table[scrollable][data-overflow-end]:not([data-overflow-start]) {
|
|
219
|
+
mask-image: linear-gradient(to right, currentcolor calc(100% - var(--_void-table-fade)), transparent);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
void-table[scrollable][data-overflow-start]:not([data-overflow-end]) {
|
|
223
|
+
mask-image: linear-gradient(to right, transparent, currentcolor var(--_void-table-fade));
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
void-table[scrollable][data-overflow-start][data-overflow-end] {
|
|
227
|
+
mask-image: linear-gradient(
|
|
228
|
+
to right,
|
|
229
|
+
transparent,
|
|
230
|
+
currentcolor var(--_void-table-fade),
|
|
231
|
+
currentcolor calc(100% - var(--_void-table-fade)),
|
|
232
|
+
transparent
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
void-table[scrollable]:dir(rtl)[data-overflow-end]:not([data-overflow-start]) {
|
|
237
|
+
mask-image: linear-gradient(to left, currentcolor calc(100% - var(--_void-table-fade)), transparent);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
void-table[scrollable]:dir(rtl)[data-overflow-start]:not([data-overflow-end]) {
|
|
241
|
+
mask-image: linear-gradient(to left, transparent, currentcolor var(--_void-table-fade));
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
void-table[scrollable]:dir(rtl)[data-overflow-start][data-overflow-end] {
|
|
245
|
+
mask-image: linear-gradient(
|
|
246
|
+
to left,
|
|
247
|
+
transparent,
|
|
248
|
+
currentcolor var(--_void-table-fade),
|
|
249
|
+
currentcolor calc(100% - var(--_void-table-fade)),
|
|
250
|
+
transparent
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* The sticky column is the start edge: no fade there, only its hairline. */
|
|
255
|
+
void-table[scrollable][sticky-column][data-overflow-start][data-overflow-end] {
|
|
256
|
+
mask-image: linear-gradient(to right, currentcolor calc(100% - var(--_void-table-fade)), transparent);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
void-table[scrollable][sticky-column][data-overflow-start]:not([data-overflow-end]) {
|
|
260
|
+
mask-image: none;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
void-table[scrollable][sticky-column]:dir(rtl)[data-overflow-start][data-overflow-end] {
|
|
264
|
+
mask-image: linear-gradient(to left, currentcolor calc(100% - var(--_void-table-fade)), transparent);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/* ── Sticky header and first column ──
|
|
268
|
+
Sticky cells are painted with the surface (nothing may show through), and
|
|
269
|
+
collapsed borders do not travel with a sticky cell, so the table separates. */
|
|
270
|
+
void-table:is([sticky-header], [sticky-column]) table {
|
|
271
|
+
border-collapse: separate;
|
|
272
|
+
border-spacing: 0;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
void-table[sticky-header] thead th {
|
|
276
|
+
position: sticky;
|
|
277
|
+
top: var(--_void-table-sticky-top);
|
|
278
|
+
z-index: 2;
|
|
279
|
+
background-color: var(--_void-table-surface);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
void-table[sticky-column] :is(th, td):first-child {
|
|
283
|
+
position: sticky;
|
|
284
|
+
inset-inline-start: 0;
|
|
285
|
+
z-index: 1;
|
|
286
|
+
background-color: var(--_void-table-surface);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
void-table[sticky-column] thead th:first-child {
|
|
290
|
+
z-index: 3;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/* Striped and hovered rows tint the sticky cell too. */
|
|
294
|
+
void-table[sticky-column][striped] tbody tr:nth-child(even) > :first-child,
|
|
295
|
+
void-table[sticky-column][hoverable] tbody tr:hover > :first-child {
|
|
296
|
+
background-image: linear-gradient(var(--void-color-bg-secondary), var(--void-color-bg-secondary));
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/* A hairline marks the sticky column's edge once content slides under it. */
|
|
300
|
+
void-table[sticky-column][data-overflow-start] :is(th, td):first-child {
|
|
301
|
+
box-shadow: inset -1px 0 0 var(--void-color-border);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
void-table[sticky-column][data-overflow-start]:dir(rtl) :is(th, td):first-child {
|
|
305
|
+
box-shadow: inset 1px 0 0 var(--void-color-border);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/* ── Stacked presentation ──
|
|
309
|
+
[stack] makes the host a size container whose font-size is the breakpoint
|
|
310
|
+
(--void-table-stack-at), so one rule set serves any breakpoint: the query
|
|
311
|
+
below reads "narrower than 1em" and em is the container's own font-size.
|
|
312
|
+
Everything inside resets font-size from tokens, so nothing else sees it.
|
|
313
|
+
Each row becomes a block of label and value pairs; the label of a pair is
|
|
314
|
+
the column's header text, copied to the cell as data-label.
|
|
315
|
+
|
|
316
|
+
Header cells stay in the page for assistive technology (clipped, not
|
|
317
|
+
hidden), except those that hold a control (select all, sort buttons),
|
|
318
|
+
which stay visible as a bar above the blocks. */
|
|
319
|
+
void-table[stack] {
|
|
320
|
+
container-type: inline-size;
|
|
321
|
+
font-size: var(--_void-table-stack-at);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
void-table[stack="always"] {
|
|
325
|
+
--_void-table-stack-at: var(--void-table-stack-at, 100000px);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
@container (max-width: 1em) {
|
|
329
|
+
void-table[stack] :is(table, caption, thead, tbody, tfoot, tr, th, td) {
|
|
330
|
+
display: block;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
void-table[stack] :is(th, td) {
|
|
334
|
+
padding: 0;
|
|
335
|
+
border: 0;
|
|
336
|
+
text-align: start;
|
|
337
|
+
min-width: 0;
|
|
338
|
+
background: none;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/* Header cells: out of sight, still announced. Cells with controls stay. */
|
|
342
|
+
void-table[stack] thead th {
|
|
343
|
+
position: absolute;
|
|
344
|
+
inline-size: 1px;
|
|
345
|
+
block-size: 1px;
|
|
346
|
+
overflow: hidden;
|
|
347
|
+
clip-path: inset(50%);
|
|
348
|
+
white-space: nowrap;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
void-table[stack] thead tr {
|
|
352
|
+
display: flex;
|
|
353
|
+
flex-wrap: wrap;
|
|
354
|
+
align-items: center;
|
|
355
|
+
gap: var(--void-space-2);
|
|
356
|
+
padding-inline: var(--_void-table-edge);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
void-table[stack] thead th[data-controls] {
|
|
360
|
+
position: static;
|
|
361
|
+
inline-size: auto;
|
|
362
|
+
block-size: auto;
|
|
363
|
+
overflow: visible;
|
|
364
|
+
clip-path: none;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
void-table[stack] thead tr[data-controls] {
|
|
368
|
+
padding-block: var(--void-space-2);
|
|
369
|
+
border-bottom: var(--void-table-rule-head, var(--void-rule-head));
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/* One row is one block. */
|
|
373
|
+
void-table[stack] :is(tbody, tfoot) tr {
|
|
374
|
+
position: relative;
|
|
375
|
+
display: grid;
|
|
376
|
+
grid-template-columns: repeat(auto-fit, minmax(min(var(--_void-table-tile), 100%), 1fr));
|
|
377
|
+
gap: var(--void-space-3) var(--void-gap-inside);
|
|
378
|
+
padding: var(--void-space-4) var(--_void-table-edge);
|
|
379
|
+
border-bottom: var(--_void-table-row-rule);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/* A long table does not lay out the blocks that are out of view, so it stacks
|
|
383
|
+
without a long frame. (Table rows cannot be skipped; grid rows can.) */
|
|
384
|
+
void-table[stack][data-long] :is(tbody, tfoot) tr {
|
|
385
|
+
content-visibility: auto;
|
|
386
|
+
contain-intrinsic-size: auto var(--_void-table-row-size);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/* A pair: the column's label over the cell's value. */
|
|
390
|
+
void-table[stack] td[data-label]:not([data-label=""], [data-stack="title"], [data-stack="select"], [data-stack="actions"])::before {
|
|
391
|
+
content: attr(data-label);
|
|
392
|
+
display: block;
|
|
393
|
+
margin-block-end: var(--void-space-0h);
|
|
394
|
+
font-family: var(--void-type-label-family);
|
|
395
|
+
font-size: var(--void-type-label-size);
|
|
396
|
+
line-height: var(--void-type-label-leading);
|
|
397
|
+
font-weight: var(--void-type-label-weight);
|
|
398
|
+
letter-spacing: var(--void-type-label-tracking);
|
|
399
|
+
text-transform: var(--void-type-label-case);
|
|
400
|
+
color: var(--void-type-label-color);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/* The block's title: first, the full width, no label. */
|
|
404
|
+
void-table[stack] td[data-stack="title"] {
|
|
405
|
+
grid-column: 1 / -1;
|
|
406
|
+
order: -1;
|
|
407
|
+
font-size: var(--void-text-md);
|
|
408
|
+
line-height: var(--void-type-body-leading);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/* A row checkbox sits beside the title. */
|
|
412
|
+
void-table[stack][data-stack-title] td[data-stack="select"] {
|
|
413
|
+
/* Placed against the row's content area (its grid area), not its padding edge. */
|
|
414
|
+
position: absolute;
|
|
415
|
+
inset-block-start: var(--void-space-4);
|
|
416
|
+
inset-inline-start: 0;
|
|
417
|
+
order: -2;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
void-table[stack][data-stack-select] td[data-stack="title"] {
|
|
421
|
+
padding-inline-start: var(--void-space-8);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
void-table[stack] td[data-stack="select"] {
|
|
425
|
+
grid-column: 1 / -1;
|
|
426
|
+
order: -2;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/* Actions: last, the full width, ghost buttons on the block's edge. */
|
|
430
|
+
void-table[stack] td[data-stack="actions"] {
|
|
431
|
+
grid-column: 1 / -1;
|
|
432
|
+
order: 99;
|
|
433
|
+
display: flex;
|
|
434
|
+
flex-wrap: wrap;
|
|
435
|
+
justify-content: flex-start;
|
|
436
|
+
gap: var(--void-space-1);
|
|
437
|
+
margin-inline-start: calc(var(--void-control-padding-sm) * -1.25);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
void-table[stack] td[data-stack="actions"] > * + * {
|
|
441
|
+
margin-inline-start: 0;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
void-table[stack] td[data-stack="actions"] > :last-child {
|
|
445
|
+
margin-inline-end: 0;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
void-table[stack] :is(th, td)[data-stack="hide"] {
|
|
449
|
+
display: none;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/* Alignment belongs to a column of a table, not to a block. */
|
|
453
|
+
void-table[stack] :is([data-align], [data-numeric]) {
|
|
454
|
+
text-align: start;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
void-table[stack][bordered] :is(tbody, tfoot) tr {
|
|
458
|
+
border: var(--void-rule-frame);
|
|
459
|
+
margin-block-end: var(--void-space-3);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
void-table[stack] :is(th, td):first-child,
|
|
463
|
+
void-table[stack] :is(th, td):last-child {
|
|
464
|
+
padding-inline: 0;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/* Sticky parts belong to the tabular presentation. */
|
|
468
|
+
void-table[stack][sticky-header] thead th,
|
|
469
|
+
void-table[stack][sticky-column] :is(th, td):first-child {
|
|
470
|
+
position: static;
|
|
471
|
+
box-shadow: none;
|
|
472
|
+
}
|
|
46
473
|
}
|
package/src/components/tabs.css
CHANGED
|
@@ -1,65 +1,128 @@
|
|
|
1
|
+
/* @tokens void-tabs
|
|
2
|
+
--void-tabs-height Height of a tab. Applies at every size step; for a proportional change set the --void-control-* steps instead.
|
|
3
|
+
--void-tabs-padding Inline padding of a tab. Applies at every size step; for a proportional change set the --void-control-* steps instead.
|
|
4
|
+
--void-tabs-font-size Size of a tab's label. Applies at every size step; for a proportional change set the --void-control-* steps instead.
|
|
5
|
+
--void-tabs-rule The line under the row of tabs. */
|
|
6
|
+
|
|
1
7
|
void-tabs {
|
|
8
|
+
--_void-tabs-height: var(--void-tabs-height, var(--void-control-height));
|
|
9
|
+
--_void-tabs-padding: var(--void-tabs-padding, var(--void-control-padding));
|
|
10
|
+
--_void-tabs-font-size: var(--void-tabs-font-size, var(--void-control-text));
|
|
11
|
+
|
|
2
12
|
display: flex;
|
|
3
13
|
flex-direction: column;
|
|
4
14
|
font-family: var(--void-font-sans);
|
|
5
15
|
}
|
|
6
16
|
|
|
7
|
-
|
|
17
|
+
/* The fades at the ends of a row of tabs that scrolls: 0 unless the row
|
|
18
|
+
overflows (set by the scroll timeline below). */
|
|
19
|
+
@property --_void-tabs-fade-start {
|
|
20
|
+
syntax: "<length>";
|
|
21
|
+
inherits: false;
|
|
22
|
+
initial-value: 0px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@property --_void-tabs-fade-end {
|
|
26
|
+
syntax: "<length>";
|
|
27
|
+
inherits: false;
|
|
28
|
+
initial-value: 0px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* A row with more tabs than fit scrolls sideways inside itself; it used to
|
|
32
|
+
push the page wider than the screen. Tabs keep their width and their
|
|
33
|
+
label on one line, and snap to the start of the row. */
|
|
34
|
+
void-tabs-list {
|
|
8
35
|
display: flex;
|
|
9
|
-
border-bottom:
|
|
10
|
-
gap: var(--void-space-
|
|
36
|
+
border-bottom: var(--void-tabs-rule, var(--void-rule-head));
|
|
37
|
+
gap: var(--void-space-2);
|
|
11
38
|
order: -1;
|
|
39
|
+
min-width: 0;
|
|
40
|
+
overflow-x: auto;
|
|
41
|
+
scrollbar-width: none;
|
|
42
|
+
overscroll-behavior-x: contain;
|
|
43
|
+
scroll-snap-type: inline proximity;
|
|
44
|
+
-webkit-mask-image: linear-gradient(to right, transparent, black var(--_void-tabs-fade-start), black calc(100% - var(--_void-tabs-fade-end)), transparent);
|
|
45
|
+
mask-image: linear-gradient(to right, transparent, black var(--_void-tabs-fade-start), black calc(100% - var(--_void-tabs-fade-end)), transparent);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
void-tabs-list::-webkit-scrollbar {
|
|
49
|
+
display: none;
|
|
12
50
|
}
|
|
13
51
|
|
|
14
|
-
|
|
15
|
-
|
|
52
|
+
/* Where the browser can tie an animation to the row's own scroll position,
|
|
53
|
+
the edge with more tabs beyond it fades out. A row that does not overflow
|
|
54
|
+
has no scroll range, so the animation does not apply and nothing fades. */
|
|
55
|
+
@supports (animation-timeline: scroll()) {
|
|
56
|
+
void-tabs-list {
|
|
57
|
+
animation: void-tabs-fade linear both;
|
|
58
|
+
animation-timeline: var(--_void-timeline, scroll(self inline));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@keyframes void-tabs-fade {
|
|
62
|
+
0% { --_void-tabs-fade-start: 0px; --_void-tabs-fade-end: var(--void-space-10); }
|
|
63
|
+
10%, 90% { --_void-tabs-fade-start: var(--void-space-10); --_void-tabs-fade-end: var(--void-space-10); }
|
|
64
|
+
100% { --_void-tabs-fade-start: var(--void-space-10); --_void-tabs-fade-end: 0px; }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* A tab: the trigger part itself is the control (role="tab", a tab stop). */
|
|
69
|
+
void-tabs-trigger {
|
|
70
|
+
display: inline-flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
flex: none;
|
|
73
|
+
box-sizing: border-box;
|
|
16
74
|
background: none;
|
|
17
75
|
border: none;
|
|
18
76
|
border-bottom: 2px solid transparent;
|
|
19
77
|
border-radius: 0;
|
|
20
|
-
|
|
78
|
+
white-space: nowrap;
|
|
79
|
+
scroll-snap-align: start;
|
|
80
|
+
min-height: var(--_void-tabs-height);
|
|
81
|
+
padding: 0 var(--_void-tabs-padding);
|
|
21
82
|
font-family: var(--void-font-sans);
|
|
22
|
-
font-size: var(--
|
|
23
|
-
color: var(--void-color-text-
|
|
83
|
+
font-size: var(--_void-tabs-font-size);
|
|
84
|
+
color: var(--void-color-text-secondary);
|
|
24
85
|
cursor: pointer;
|
|
25
86
|
transition: color var(--void-duration-fast) var(--void-ease-in-out),
|
|
26
87
|
background var(--void-duration-fast) var(--void-ease-in-out),
|
|
27
88
|
border-bottom-color var(--void-duration-fast) var(--void-ease-in-out);
|
|
28
|
-
|
|
89
|
+
/* The marker of the selected tab sits on the row's rule, not over it: the
|
|
90
|
+
row is a scroll container, and anything that reached outside it (a
|
|
91
|
+
negative margin, an outline outside the tab) would be cut off. */
|
|
29
92
|
outline: none;
|
|
93
|
+
user-select: none;
|
|
30
94
|
}
|
|
31
95
|
|
|
32
|
-
|
|
96
|
+
void-tabs-trigger:hover {
|
|
33
97
|
color: var(--void-color-text);
|
|
34
|
-
background: var(--void-color-bg-hover);
|
|
35
98
|
}
|
|
36
99
|
|
|
37
|
-
|
|
38
|
-
outline:
|
|
39
|
-
outline-offset:
|
|
100
|
+
void-tabs-trigger:focus-visible {
|
|
101
|
+
outline: var(--void-focus-ring-width) solid var(--void-focus-ring-color);
|
|
102
|
+
outline-offset: calc(-1 * var(--void-focus-ring-width));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
void-tabs-trigger[disabled] {
|
|
106
|
+
opacity: 0.5;
|
|
107
|
+
cursor: default;
|
|
108
|
+
pointer-events: none;
|
|
40
109
|
}
|
|
41
110
|
|
|
42
|
-
|
|
43
|
-
|
|
111
|
+
/* [active] is written by <void-tabs>, and may be rendered by the server so the
|
|
112
|
+
selected tab shows before the script loads. */
|
|
113
|
+
void-tabs-trigger[active] {
|
|
114
|
+
color: var(--void-color-text);
|
|
44
115
|
border-bottom-color: var(--void-color-accent);
|
|
45
|
-
font-weight: var(--void-weight-medium);
|
|
46
116
|
}
|
|
47
117
|
|
|
48
|
-
void-
|
|
118
|
+
void-tabs-content {
|
|
49
119
|
display: none;
|
|
50
|
-
padding-top: var(--void-
|
|
120
|
+
padding-top: var(--void-gap-inside);
|
|
51
121
|
}
|
|
52
122
|
|
|
53
|
-
void-
|
|
123
|
+
void-tabs-content[active] {
|
|
54
124
|
display: block;
|
|
55
125
|
}
|
|
56
126
|
|
|
57
|
-
void-tabs[size="sm"]
|
|
58
|
-
|
|
59
|
-
font-size: var(--void-text-xs);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
void-tabs[size="lg"] .void-tabs-tab {
|
|
63
|
-
padding: var(--void-space-3) var(--void-space-4);
|
|
64
|
-
font-size: var(--void-text-base);
|
|
65
|
-
}
|
|
127
|
+
void-tabs[size="sm"] { --_void-tabs-height: var(--void-tabs-height, var(--void-control-height-sm)); --_void-tabs-padding: var(--void-tabs-padding, var(--void-control-padding-sm)); --_void-tabs-font-size: var(--void-tabs-font-size, var(--void-control-text-sm)); }
|
|
128
|
+
void-tabs[size="lg"] { --_void-tabs-height: var(--void-tabs-height, var(--void-control-height-lg)); --_void-tabs-padding: var(--void-tabs-padding, var(--void-control-padding-lg)); --_void-tabs-font-size: var(--void-tabs-font-size, var(--void-control-text-lg)); }
|