@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/core.css
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
@import './layers.css';
|
|
2
|
+
|
|
3
|
+
@import './primitives.css' layer(components.void.tokens);
|
|
4
|
+
@import './knobs.css' layer(components.void.tokens);
|
|
5
|
+
@import './tokens.css' layer(components.void.tokens);
|
|
6
|
+
@import './reset.css' layer(components.void.reset);
|
|
7
|
+
@import './type.css' layer(components.void.type);
|
|
8
|
+
/* Shared overlay rules (top layer, anchoring, transitions); before the components that refine them. */
|
|
9
|
+
@import './components/overlay.css' layer(components.void.components);
|
|
10
|
+
@import './components/badge.css' layer(components.void.components);
|
|
11
|
+
@import './components/button.css' layer(components.void.components);
|
|
12
|
+
@import './components/divider.css' layer(components.void.components);
|
|
13
|
+
@import './components/spinner.css' layer(components.void.components);
|
|
14
|
+
@import './components/skeleton.css' layer(components.void.components);
|
|
15
|
+
@import './components/status-dot.css' layer(components.void.components);
|
|
16
|
+
@import './components/switch.css' layer(components.void.components);
|
|
17
|
+
@import './components/avatar.css' layer(components.void.components);
|
|
18
|
+
@import './components/alert.css' layer(components.void.components);
|
|
19
|
+
@import './components/tag.css' layer(components.void.components);
|
|
20
|
+
@import './components/progress.css' layer(components.void.components);
|
|
21
|
+
@import './components/panel.css' layer(components.void.components);
|
|
22
|
+
@import './components/input.css' layer(components.void.components);
|
|
23
|
+
@import './components/textarea.css' layer(components.void.components);
|
|
24
|
+
@import './components/select.css' layer(components.void.components);
|
|
25
|
+
@import './components/checkbox.css' layer(components.void.components);
|
|
26
|
+
@import './components/radio.css' layer(components.void.components);
|
|
27
|
+
@import './components/radio-group.css' layer(components.void.components);
|
|
28
|
+
@import './components/field.css' layer(components.void.components);
|
|
29
|
+
@import './components/multiselect.css' layer(components.void.components);
|
|
30
|
+
@import './components/dialog.css' layer(components.void.components);
|
|
31
|
+
@import './components/tabs.css' layer(components.void.components);
|
|
32
|
+
@import './components/accordion.css' layer(components.void.components);
|
|
33
|
+
@import './components/breadcrumbs.css' layer(components.void.components);
|
|
34
|
+
@import './components/list.css' layer(components.void.components);
|
|
35
|
+
@import './components/toast.css' layer(components.void.components);
|
|
36
|
+
@import './components/stepper.css' layer(components.void.components);
|
|
37
|
+
@import './components/drawer.css' layer(components.void.components);
|
|
38
|
+
@import './components/card.css' layer(components.void.components);
|
|
39
|
+
@import './components/popover.css' layer(components.void.components);
|
|
40
|
+
@import './components/tooltip.css' layer(components.void.components);
|
|
41
|
+
@import './components/banner.css' layer(components.void.components);
|
|
42
|
+
@import './components/scroll-area.css' layer(components.void.components);
|
|
43
|
+
@import './components/table.css' layer(components.void.components);
|
|
44
|
+
@import './components/pagination.css' layer(components.void.components);
|
|
45
|
+
@import './components/error-fallback.css' layer(components.void.components);
|
|
46
|
+
@import './components/checkbox-group.css' layer(components.void.components);
|
|
47
|
+
@import './components/combobox.css' layer(components.void.components);
|
|
48
|
+
@import './components/slider.css' layer(components.void.components);
|
|
49
|
+
@import './components/file-upload.css' layer(components.void.components);
|
|
50
|
+
@import './components/nav-bar.css' layer(components.void.components);
|
|
51
|
+
@import './components/hamburger.css' layer(components.void.components);
|
|
52
|
+
@import './components/compose-input.css' layer(components.void.components);
|
|
53
|
+
@import './components/sidebar.css' layer(components.void.components);
|
|
54
|
+
@import './components/segmented-control.css' layer(components.void.components);
|
|
55
|
+
@import './components/toggle.css' layer(components.void.components);
|
|
56
|
+
@import './components/toggle-group.css' layer(components.void.components);
|
|
57
|
+
@import './components/stat.css' layer(components.void.components);
|
|
58
|
+
|
|
59
|
+
@import './components/calendar.css' layer(components.void.components);
|
|
60
|
+
@import './components/carousel.css' layer(components.void.components);
|
|
61
|
+
@import './components/dropdown-menu.css' layer(components.void.components);
|
|
62
|
+
@import './components/indicator.css' layer(components.void.components);
|
|
63
|
+
@import './components/menu.css' layer(components.void.components);
|
|
64
|
+
@import './components/number-input.css' layer(components.void.components);
|
|
65
|
+
@import './components/collapsible.css' layer(components.void.components);
|
|
66
|
+
@import './components/editable.css' layer(components.void.components);
|
|
67
|
+
@import './components/hover-card.css' layer(components.void.components);
|
|
68
|
+
@import './components/pin-input.css' layer(components.void.components);
|
|
69
|
+
@import './components/tags-input.css' layer(components.void.components);
|
|
70
|
+
@import './components/nav-menu.css' layer(components.void.components);
|
|
71
|
+
@import './components/color-picker.css' layer(components.void.components);
|
|
72
|
+
@import './components/action-input.css' layer(components.void.components);
|
|
73
|
+
|
|
74
|
+
/* Patterns: CSS-only elements for the recurring pieces of a screen */
|
|
75
|
+
@import './patterns/shell.css' layer(components.void.patterns);
|
|
76
|
+
@import './patterns/page.css' layer(components.void.patterns);
|
|
77
|
+
@import './patterns/data.css' layer(components.void.patterns);
|
|
78
|
+
|
|
79
|
+
/* UI over imagery: the media surface, on-media and glass */
|
|
80
|
+
@import './media/media.css' layer(components.void.patterns);
|
|
81
|
+
@import './media/surface.css' layer(components.void.patterns);
|
|
82
|
+
|
|
83
|
+
/* App-shell layout primitives */
|
|
84
|
+
@import './app-shell/detail.css' layer(components.void.patterns);
|
|
85
|
+
@import './app-shell/modal-actions.css' layer(components.void.patterns);
|
|
86
|
+
@import './app-shell/subtable.css' layer(components.void.patterns);
|
|
87
|
+
|
|
88
|
+
/* Charts */
|
|
89
|
+
@import './components/bar-chart.css' layer(components.void.components);
|
|
90
|
+
@import './components/line-chart.css' layer(components.void.components);
|
|
91
|
+
@import './components/donut-chart.css' layer(components.void.components);
|
|
92
|
+
@import './components/gauge.css' layer(components.void.components);
|
|
93
|
+
|
|
94
|
+
/* Pre-upgrade state: :not(:defined) rules, after every component file */
|
|
95
|
+
@import './pre-upgrade.css' layer(components.void.components);
|
|
96
|
+
|
|
97
|
+
/* Accessibility: forced-colors (keep last so it wins) */
|
|
98
|
+
@import './forced-colors.css' layer(components.void.a11y);
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/* ============================================================
|
|
2
|
+
@voidable/theme — Windows High Contrast / forced-colors support
|
|
3
|
+
Many components replace the outline with a box-shadow or a border
|
|
4
|
+
colour change for focus; forced-colors mode drops box-shadows and
|
|
5
|
+
remaps colours, so the focus indicator would disappear. Restore a
|
|
6
|
+
real outline and keep control state visible using system colours.
|
|
7
|
+
============================================================ */
|
|
8
|
+
|
|
9
|
+
@media (forced-colors: active) {
|
|
10
|
+
/* The focus outline is in reset.css, scoped to the theme's own elements. */
|
|
11
|
+
|
|
12
|
+
/* Control boundaries in explicit system colours (translucent
|
|
13
|
+
border colours would otherwise rely on UA remapping alone). */
|
|
14
|
+
void-input input,
|
|
15
|
+
void-textarea textarea,
|
|
16
|
+
void-select select,
|
|
17
|
+
void-segmented-control,
|
|
18
|
+
void-button,
|
|
19
|
+
.void-combobox-input,
|
|
20
|
+
.void-pin-cell,
|
|
21
|
+
.void-compose-input-wrapper,
|
|
22
|
+
.void-checkbox-box,
|
|
23
|
+
.void-radio-circle,
|
|
24
|
+
.void-switch-track {
|
|
25
|
+
border-color: ButtonText;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Container boundaries. Forced colours removes fills and shadows, so a box
|
|
29
|
+
a skin draws with a lighter fill and a shadow (Loft's cards, section and
|
|
30
|
+
figure tiles, its bar) would have no boundary at all. Each of these (and
|
|
31
|
+
the section, figure and page-actions patterns, in their own files) has
|
|
32
|
+
an edge whose thickness is a token; where a skin has given it one, it is
|
|
33
|
+
drawn in a system colour, whatever colour (often transparent) the skin
|
|
34
|
+
chose. Where the thickness is 0, as for a section of the default theme,
|
|
35
|
+
there is still no box. lint:component-tokens refuses a skin that gives
|
|
36
|
+
one of them a fill or a shadow and no thickness. */
|
|
37
|
+
void-card,
|
|
38
|
+
void-panel,
|
|
39
|
+
void-stat,
|
|
40
|
+
void-alert,
|
|
41
|
+
void-nav-bar {
|
|
42
|
+
border-color: CanvasText;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* A ghost button draws nothing at rest, here too: its border takes the
|
|
46
|
+
page colour, and shows on hover, focus and press, since the hover
|
|
47
|
+
fill is a background and forced colours repaint that to Canvas. */
|
|
48
|
+
void-button[variant="ghost"] {
|
|
49
|
+
border-color: Canvas;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
void-button[variant="ghost"]:hover,
|
|
53
|
+
void-button[variant="ghost"]:focus-visible,
|
|
54
|
+
void-button[variant="ghost"]:active {
|
|
55
|
+
border-color: ButtonText;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
void-button[variant="ghost"][disabled] {
|
|
59
|
+
border-color: Canvas;
|
|
60
|
+
color: GrayText;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Checked / on states must differ from unchecked without a fill colour */
|
|
64
|
+
void-checkbox[checked] .void-checkbox-box,
|
|
65
|
+
void-checkbox[indeterminate] .void-checkbox-box,
|
|
66
|
+
void-radio[checked] .void-radio-circle,
|
|
67
|
+
void-switch[checked] .void-switch-track {
|
|
68
|
+
background: Highlight;
|
|
69
|
+
border-color: Highlight;
|
|
70
|
+
color: HighlightText;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.void-radio-dot,
|
|
74
|
+
void-switch[checked] .void-switch-thumb {
|
|
75
|
+
background: HighlightText;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.void-switch-thumb {
|
|
79
|
+
background: ButtonText;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Selected state: backgrounds and accent colours are remapped, so a selected
|
|
83
|
+
tab, segment or day would match the unselected ones. System colours are
|
|
84
|
+
preserved, so mark selection with Highlight / HighlightText. */
|
|
85
|
+
void-tabs-trigger[aria-selected="true"] {
|
|
86
|
+
color: Highlight;
|
|
87
|
+
border-bottom-color: Highlight;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
void-segmented-control-item[aria-checked="true"],
|
|
91
|
+
.void-calendar-day.selected {
|
|
92
|
+
background: Highlight;
|
|
93
|
+
color: HighlightText;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
void-segmented-control-item[aria-checked="true"] {
|
|
97
|
+
forced-color-adjust: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Track and fill are plain backgrounds, which forced colours repaint to
|
|
101
|
+
Canvas: outline the track and fill the value with Highlight. */
|
|
102
|
+
.void-progress-track {
|
|
103
|
+
border: 1px solid ButtonText;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.void-progress-fill {
|
|
107
|
+
background: Highlight;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
void-slider input[type="range"] {
|
|
111
|
+
border: 1px solid ButtonText;
|
|
112
|
+
background: linear-gradient(
|
|
113
|
+
to right,
|
|
114
|
+
Highlight var(--void-slider-fill, 50%),
|
|
115
|
+
Canvas var(--void-slider-fill, 50%)
|
|
116
|
+
);
|
|
117
|
+
forced-color-adjust: none;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
void-slider input[type="range"]::-webkit-slider-thumb {
|
|
121
|
+
background: Highlight;
|
|
122
|
+
border: 2px solid ButtonText;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
void-slider input[type="range"]::-moz-range-track {
|
|
126
|
+
background: Canvas;
|
|
127
|
+
border: 1px solid ButtonText;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
void-slider input[type="range"]::-moz-range-thumb {
|
|
131
|
+
background: Highlight;
|
|
132
|
+
border: 2px solid ButtonText;
|
|
133
|
+
}
|
|
134
|
+
}
|
package/src/index.css
CHANGED
|
@@ -1,71 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
@import './
|
|
4
|
-
@import './
|
|
5
|
-
@import './components/button.css';
|
|
6
|
-
@import './components/divider.css';
|
|
7
|
-
@import './components/spinner.css';
|
|
8
|
-
@import './components/skeleton.css';
|
|
9
|
-
@import './components/status-dot.css';
|
|
10
|
-
@import './components/switch.css';
|
|
11
|
-
@import './components/avatar.css';
|
|
12
|
-
@import './components/alert.css';
|
|
13
|
-
@import './components/tag.css';
|
|
14
|
-
@import './components/progress.css';
|
|
15
|
-
@import './components/panel.css';
|
|
16
|
-
@import './components/input.css';
|
|
17
|
-
@import './components/textarea.css';
|
|
18
|
-
@import './components/select.css';
|
|
19
|
-
@import './components/checkbox.css';
|
|
20
|
-
@import './components/radio.css';
|
|
21
|
-
@import './components/radio-group.css';
|
|
22
|
-
@import './components/field.css';
|
|
23
|
-
@import './components/multiselect.css';
|
|
24
|
-
@import './components/dialog.css';
|
|
25
|
-
@import './components/tabs.css';
|
|
26
|
-
@import './components/accordion.css';
|
|
27
|
-
@import './components/breadcrumbs.css';
|
|
28
|
-
@import './components/list.css';
|
|
29
|
-
@import './components/toast.css';
|
|
30
|
-
@import './components/stepper.css';
|
|
31
|
-
@import './components/drawer.css';
|
|
32
|
-
@import './components/card.css';
|
|
33
|
-
@import './components/popover.css';
|
|
34
|
-
@import './components/tooltip.css';
|
|
35
|
-
@import './components/banner.css';
|
|
36
|
-
@import './components/scroll-area.css';
|
|
37
|
-
@import './components/table.css';
|
|
38
|
-
@import './components/pagination.css';
|
|
39
|
-
@import './components/error-fallback.css';
|
|
40
|
-
@import './components/checkbox-group.css';
|
|
41
|
-
@import './components/combobox.css';
|
|
42
|
-
@import './components/slider.css';
|
|
43
|
-
@import './components/file-upload.css';
|
|
44
|
-
@import './components/nav-bar.css';
|
|
45
|
-
@import './components/hamburger.css';
|
|
46
|
-
@import './components/compose-input.css';
|
|
47
|
-
@import './components/sidebar.css';
|
|
48
|
-
@import './components/segmented-control.css';
|
|
49
|
-
@import './components/toggle.css';
|
|
50
|
-
@import './components/toggle-group.css';
|
|
51
|
-
@import './components/stat.css';
|
|
52
|
-
|
|
53
|
-
@import './components/calendar.css';
|
|
54
|
-
@import './components/carousel.css';
|
|
55
|
-
@import './components/dropdown-menu.css';
|
|
56
|
-
@import './components/indicator.css';
|
|
57
|
-
@import './components/menu.css';
|
|
58
|
-
@import './components/number-input.css';
|
|
59
|
-
@import './components/collapsible.css';
|
|
60
|
-
@import './components/editable.css';
|
|
61
|
-
@import './components/hover-card.css';
|
|
62
|
-
@import './components/pin-input.css';
|
|
63
|
-
@import './components/tags-input.css';
|
|
64
|
-
@import './components/nav-menu.css';
|
|
65
|
-
@import './components/color-picker.css';
|
|
66
|
-
@import './components/action-input.css';
|
|
67
|
-
|
|
68
|
-
/* App-shell layout primitives */
|
|
69
|
-
@import './app-shell/detail.css';
|
|
70
|
-
@import './app-shell/modal-actions.css';
|
|
71
|
-
@import './app-shell/subtable.css';
|
|
1
|
+
/* Everything: the core (tokens, reset, components, patterns) and the optional
|
|
2
|
+
base. `core.css` is the same without the base; see base.css. */
|
|
3
|
+
@import './core.css';
|
|
4
|
+
@import './base.css' layer(components.void.reset);
|
package/src/knobs.css
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* ============================================================
|
|
2
|
+
@voidable/theme — Knobs
|
|
3
|
+
The handful of inputs the whole theme derives from. To retheme,
|
|
4
|
+
change these and nothing else: every colour, size, radius and
|
|
5
|
+
duration in tokens.css is computed from them, in both colour
|
|
6
|
+
schemes, with no build step.
|
|
7
|
+
|
|
8
|
+
Set them on :root for the whole page:
|
|
9
|
+
|
|
10
|
+
:root { --void-accent-chroma: 0.16; --void-accent-hue: 250; }
|
|
11
|
+
|
|
12
|
+
or on any element that carries data-void-theme (any value, or
|
|
13
|
+
none) to restyle just that subtree:
|
|
14
|
+
|
|
15
|
+
<section data-void-theme style="--void-radius: 0px">…</section>
|
|
16
|
+
|
|
17
|
+
The attribute is what makes the derived tokens recompute there;
|
|
18
|
+
a knob set on an element without it changes nothing below it.
|
|
19
|
+
|
|
20
|
+
Knobs are plain numbers and lengths on purpose, so that a person
|
|
21
|
+
or an agent can set them without knowing the rest of the theme.
|
|
22
|
+
============================================================ */
|
|
23
|
+
|
|
24
|
+
:root {
|
|
25
|
+
/* ── Colour ─────────────────────────────────────────────── */
|
|
26
|
+
|
|
27
|
+
/* Accent: the colour of primary actions, selection and focus.
|
|
28
|
+
Chroma 0 (the default) means no accent colour at all: primary
|
|
29
|
+
actions are the inverse of the page (white on black, black on
|
|
30
|
+
white) and colour is left to status. Raise chroma to 0.10–0.20
|
|
31
|
+
for a coloured accent; hue is an OKLCH angle in degrees
|
|
32
|
+
(30 red, 60 orange, 90 yellow, 150 green, 200 teal, 250 blue,
|
|
33
|
+
300 purple, 350 pink). Lightness is chosen for you per colour
|
|
34
|
+
scheme so that text on the accent and the accent as text both
|
|
35
|
+
keep 4.5:1. */
|
|
36
|
+
--void-accent-hue: 250;
|
|
37
|
+
--void-accent-chroma: 0;
|
|
38
|
+
|
|
39
|
+
/* Neutral: the tint of text, borders and surfaces. Every grey is
|
|
40
|
+
this one colour at a different opacity over a pure black or
|
|
41
|
+
pure white page. Chroma 0 is pure grey; 0.004 is the default
|
|
42
|
+
barely-warm stone; 0.02 is clearly tinted. Hue as above. */
|
|
43
|
+
--void-neutral-hue: 60;
|
|
44
|
+
--void-neutral-chroma: 0.004;
|
|
45
|
+
|
|
46
|
+
/* Page tint: how much of the neutral tint the page itself takes,
|
|
47
|
+
from 0 to 1. 0 (default) is a pure black or pure white page. 1 is
|
|
48
|
+
a soft page: off-white paper in light, a lifted near-black in
|
|
49
|
+
dark, both in the neutral hue. Status colours shift with it so
|
|
50
|
+
their contrast holds. */
|
|
51
|
+
--void-page-tint: 0;
|
|
52
|
+
|
|
53
|
+
/* Contrast: how strong secondary text and control borders are,
|
|
54
|
+
from 0 to 1. 0 is the softest setting that still meets WCAG AA
|
|
55
|
+
(4.5:1 for text, 3:1 for control borders); 1 is the strongest.
|
|
56
|
+
Values outside 0–1 are clamped, so no setting can take text
|
|
57
|
+
below 4.5:1. prefers-contrast: more raises it to 1. */
|
|
58
|
+
--void-contrast: 0.2;
|
|
59
|
+
|
|
60
|
+
/* Chrome: how much the containers draw, from 0 to 1. It sets the
|
|
61
|
+
strength of divider lines and the fill of cards and panels.
|
|
62
|
+
0 is faint hairlines and no fills; 0.3 (default) is quiet
|
|
63
|
+
hairlines with a fill you can barely see; 1 is clear lines and
|
|
64
|
+
visibly filled containers. Decorative only: control borders and
|
|
65
|
+
text follow --void-contrast instead. */
|
|
66
|
+
--void-chrome: 0.3;
|
|
67
|
+
|
|
68
|
+
/* ── Shape and size ─────────────────────────────────────── */
|
|
69
|
+
|
|
70
|
+
/* Radius of a control (button, input). Larger and smaller radii
|
|
71
|
+
scale from it. 0px is square; 999px makes controls pills (cards
|
|
72
|
+
and dialogs stop at 24–32px). */
|
|
73
|
+
--void-radius: 4px;
|
|
74
|
+
|
|
75
|
+
/* Density: the size of things inside components. 1 gives 36px
|
|
76
|
+
controls; 0.8 is compact (about 29px), 1.15 is roomy (about
|
|
77
|
+
41px). Scales control height, padding and the spacing scale. */
|
|
78
|
+
--void-density: 1;
|
|
79
|
+
|
|
80
|
+
/* Rhythm: the space between groups and sections of a page,
|
|
81
|
+
independent of density. Compact controls with generous rhythm
|
|
82
|
+
is what makes a screen read as airy. */
|
|
83
|
+
--void-rhythm: 1;
|
|
84
|
+
|
|
85
|
+
/* ── Type ───────────────────────────────────────────────── */
|
|
86
|
+
|
|
87
|
+
/* Body text size; every other text size scales from it. */
|
|
88
|
+
--void-font-size: 0.875rem;
|
|
89
|
+
|
|
90
|
+
/* Typefaces. The theme names them but ships no font files: load
|
|
91
|
+
them yourself (for example @fontsource-variable/inter), or the
|
|
92
|
+
next family in each stack is used. */
|
|
93
|
+
--void-font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
|
|
94
|
+
--void-font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Fira Code', monospace;
|
|
95
|
+
|
|
96
|
+
/* ── Motion ─────────────────────────────────────────────── */
|
|
97
|
+
|
|
98
|
+
/* Multiplies every duration. 1 is default, 0 switches animation
|
|
99
|
+
off, 2 is half speed. prefers-reduced-motion sets it to 0. */
|
|
100
|
+
--void-anim-scale: 1;
|
|
101
|
+
}
|
package/src/layers.css
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* The layer order of the whole theme, declared once and first.
|
|
2
|
+
|
|
3
|
+
Every file the theme ships declares this same statement before its own
|
|
4
|
+
rules, so the order is right whichever stylesheet the browser sees first.
|
|
5
|
+
A statement that repeats names already declared changes nothing.
|
|
6
|
+
|
|
7
|
+
The theme's layers are children of `components`, the layer Tailwind v4 and
|
|
8
|
+
most other setups put component styles in. Lowest to highest:
|
|
9
|
+
|
|
10
|
+
components.void.reset the scoped reset and the optional base (html, body)
|
|
11
|
+
components.void.tokens primitives, knobs, derived tokens and scheme
|
|
12
|
+
components.void.themes the demonstration themes (they set knobs only)
|
|
13
|
+
components.void.type the data-void-type roles
|
|
14
|
+
components.void.components every void-* component, and its pre-upgrade state
|
|
15
|
+
components.void.patterns CSS-only elements, media and glass, app-shell classes
|
|
16
|
+
components.void.skins opt-in skins (data-void-skin): derived-token overrides,
|
|
17
|
+
then direct rules on components and patterns, so a
|
|
18
|
+
skin must beat both whatever the specificity
|
|
19
|
+
components.void.a11y forced-colors adjustments, above the skins so a skin
|
|
20
|
+
never hides a focus ring or a forced colour
|
|
21
|
+
|
|
22
|
+
Why children of `components` and not layers of their own: a layer's place
|
|
23
|
+
among the top-level layers is fixed by whichever statement names it first.
|
|
24
|
+
If an app loads Tailwind first (it declares theme, base, components and
|
|
25
|
+
utilities), top-level `void.*` layers would land after `utilities` and beat
|
|
26
|
+
every utility class. As children of `components` the theme sits under
|
|
27
|
+
`utilities` and over `base` (the framework's reset) and `theme`, and under
|
|
28
|
+
the app's own rules written directly in `components`: the same order
|
|
29
|
+
whichever stylesheet loads first.
|
|
30
|
+
|
|
31
|
+
CSS an application writes outside any layer beats all of them, whatever
|
|
32
|
+
its specificity, so it needs no !important and no selector tricks.
|
|
33
|
+
|
|
34
|
+
`theme`, `base`, `components` and `utilities` are the names Tailwind v4
|
|
35
|
+
uses. Naming `theme` and `base` before the theme's layers and `utilities`
|
|
36
|
+
after them fixes where they sit whichever stylesheet loads first. Without
|
|
37
|
+
a framework they are empty. */
|
|
38
|
+
@layer theme, base, components.void.reset, components.void.tokens, components.void.themes, components.void.type, components.void.components, components.void.patterns, components.void.skins, components.void.a11y, utilities;
|