@voidable/theme 0.7.0 → 0.8.1
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/dist/base.css +20 -0
- package/dist/base.min.css +1 -0
- package/dist/component-tokens.json +1015 -0
- package/dist/components/accordion.css +149 -0
- package/dist/components/accordion.min.css +1 -0
- package/dist/components/action-input.css +416 -0
- package/dist/components/action-input.min.css +1 -0
- package/dist/components/alert.css +151 -0
- package/dist/components/alert.min.css +1 -0
- package/dist/components/avatar.css +73 -0
- package/dist/components/avatar.min.css +1 -0
- package/dist/components/badge.css +108 -0
- package/dist/components/badge.min.css +1 -0
- package/dist/components/banner.css +149 -0
- package/dist/components/banner.min.css +1 -0
- package/dist/components/bar-chart.css +101 -0
- package/dist/components/bar-chart.min.css +1 -0
- package/dist/components/breadcrumbs.css +82 -0
- package/dist/components/breadcrumbs.min.css +1 -0
- package/dist/components/button.css +237 -0
- package/dist/components/button.min.css +1 -0
- package/dist/components/calendar.css +669 -0
- package/dist/components/calendar.min.css +1 -0
- package/dist/components/card.css +161 -0
- package/dist/components/card.min.css +1 -0
- package/dist/components/carousel.css +223 -0
- package/dist/components/carousel.min.css +1 -0
- package/dist/components/checkbox-group.css +68 -0
- package/dist/components/checkbox-group.min.css +1 -0
- package/dist/components/checkbox.css +169 -0
- package/dist/components/checkbox.min.css +1 -0
- package/dist/components/collapsible.css +152 -0
- package/dist/components/collapsible.min.css +1 -0
- package/dist/components/color-picker.css +364 -0
- package/dist/components/color-picker.min.css +1 -0
- package/dist/components/combobox.css +548 -0
- package/dist/components/combobox.min.css +1 -0
- package/dist/components/compose-input.css +117 -0
- package/dist/components/compose-input.min.css +1 -0
- package/dist/components/dialog.css +175 -0
- package/dist/components/dialog.min.css +1 -0
- package/dist/components/divider.css +84 -0
- package/dist/components/divider.min.css +1 -0
- package/dist/components/donut-chart.css +122 -0
- package/dist/components/donut-chart.min.css +1 -0
- package/dist/components/drawer.css +230 -0
- package/dist/components/drawer.min.css +1 -0
- package/dist/components/dropdown-menu.css +274 -0
- package/dist/components/dropdown-menu.min.css +1 -0
- package/dist/components/editable.css +141 -0
- package/dist/components/editable.min.css +1 -0
- package/dist/components/error-fallback.css +129 -0
- package/dist/components/error-fallback.min.css +1 -0
- package/dist/components/field.css +103 -0
- package/dist/components/field.min.css +1 -0
- package/dist/components/file-upload.css +156 -0
- package/dist/components/file-upload.min.css +1 -0
- package/dist/components/gauge.css +186 -0
- package/dist/components/gauge.min.css +1 -0
- package/dist/components/hamburger.css +114 -0
- package/dist/components/hamburger.min.css +1 -0
- package/dist/components/hover-card.css +220 -0
- package/dist/components/hover-card.min.css +1 -0
- package/dist/components/indicator.css +159 -0
- package/dist/components/indicator.min.css +1 -0
- package/dist/components/input.css +134 -0
- package/dist/components/input.min.css +1 -0
- package/dist/components/line-chart.css +157 -0
- package/dist/components/line-chart.min.css +1 -0
- package/dist/components/list.css +90 -0
- package/dist/components/list.min.css +1 -0
- package/dist/components/menu.css +208 -0
- package/dist/components/menu.min.css +1 -0
- package/dist/components/multiselect.css +397 -0
- package/dist/components/multiselect.min.css +1 -0
- package/dist/components/nav-bar.css +75 -0
- package/dist/components/nav-bar.min.css +1 -0
- package/dist/components/nav-menu.css +173 -0
- package/dist/components/nav-menu.min.css +1 -0
- package/dist/components/number-input.css +272 -0
- package/dist/components/number-input.min.css +1 -0
- package/dist/components/pagination.css +128 -0
- package/dist/components/pagination.min.css +1 -0
- package/dist/components/panel.css +96 -0
- package/dist/components/panel.min.css +1 -0
- package/dist/components/pin-input.css +185 -0
- package/dist/components/pin-input.min.css +1 -0
- package/dist/components/popover.css +227 -0
- package/dist/components/popover.min.css +1 -0
- package/dist/components/progress.css +148 -0
- package/dist/components/progress.min.css +1 -0
- package/dist/components/radio-group.css +64 -0
- package/dist/components/radio-group.min.css +1 -0
- package/dist/components/radio.css +174 -0
- package/dist/components/radio.min.css +1 -0
- package/dist/components/scroll-area.css +83 -0
- package/dist/components/scroll-area.min.css +1 -0
- package/dist/components/segmented-control.css +158 -0
- package/dist/components/segmented-control.min.css +1 -0
- package/dist/components/select.css +207 -0
- package/dist/components/select.min.css +1 -0
- package/dist/components/sidebar.css +62 -0
- package/dist/components/sidebar.min.css +1 -0
- package/dist/components/skeleton.css +85 -0
- package/dist/components/skeleton.min.css +1 -0
- package/dist/components/slider.css +193 -0
- package/dist/components/slider.min.css +1 -0
- package/dist/components/spinner.css +100 -0
- package/dist/components/spinner.min.css +1 -0
- package/dist/components/stat.css +177 -0
- package/dist/components/stat.min.css +1 -0
- package/dist/components/status-dot.css +60 -0
- package/dist/components/status-dot.min.css +1 -0
- package/dist/components/stepper.css +114 -0
- package/dist/components/stepper.min.css +1 -0
- package/dist/components/switch.css +175 -0
- package/dist/components/switch.min.css +1 -0
- package/dist/components/table.css +416 -0
- package/dist/components/table.min.css +1 -0
- package/dist/components/tabs.css +185 -0
- package/dist/components/tabs.min.css +1 -0
- package/dist/components/tag.css +134 -0
- package/dist/components/tag.min.css +1 -0
- package/dist/components/tags-input.css +267 -0
- package/dist/components/tags-input.min.css +1 -0
- package/dist/components/textarea.css +127 -0
- package/dist/components/textarea.min.css +1 -0
- package/dist/components/toast.css +200 -0
- package/dist/components/toast.min.css +1 -0
- package/dist/components/toggle-group.css +59 -0
- package/dist/components/toggle-group.min.css +1 -0
- package/dist/components/toggle.css +139 -0
- package/dist/components/toggle.min.css +1 -0
- package/dist/components/tooltip.css +221 -0
- package/dist/components/tooltip.min.css +1 -0
- package/dist/core.css +9657 -0
- package/dist/core.min.css +1 -0
- package/dist/dtcg/aurora.dark.tokens.json +4723 -0
- package/dist/dtcg/aurora.light.tokens.json +4723 -0
- package/dist/dtcg/capsule.dark.tokens.json +4723 -0
- package/dist/dtcg/capsule.light.tokens.json +4723 -0
- package/dist/dtcg/console.dark.tokens.json +4723 -0
- package/dist/dtcg/console.light.tokens.json +4723 -0
- package/dist/dtcg/dune.dark.tokens.json +4723 -0
- package/dist/dtcg/dune.light.tokens.json +4723 -0
- package/dist/dtcg/iris.dark.tokens.json +4723 -0
- package/dist/dtcg/iris.light.tokens.json +4723 -0
- package/dist/dtcg/loft.dark.tokens.json +5203 -0
- package/dist/dtcg/loft.light.tokens.json +5203 -0
- package/dist/dtcg/orbit.dark.tokens.json +4723 -0
- package/dist/dtcg/orbit.light.tokens.json +4723 -0
- package/dist/dtcg/paper.dark.tokens.json +4723 -0
- package/dist/dtcg/paper.light.tokens.json +4723 -0
- package/dist/dtcg/slab.dark.tokens.json +4969 -0
- package/dist/dtcg/slab.light.tokens.json +4969 -0
- package/dist/dtcg/void.dark.tokens.json +4723 -0
- package/dist/dtcg/void.light.tokens.json +4723 -0
- package/dist/dtcg/voidable.resolver.json +117 -0
- package/dist/exports.json +708 -0
- package/dist/json/aurora.dark.json +394 -0
- package/dist/json/aurora.light.json +394 -0
- package/dist/json/capsule.dark.json +394 -0
- package/dist/json/capsule.light.json +394 -0
- package/dist/json/console.dark.json +394 -0
- package/dist/json/console.light.json +394 -0
- package/dist/json/dune.dark.json +394 -0
- package/dist/json/dune.light.json +394 -0
- package/dist/json/iris.dark.json +394 -0
- package/dist/json/iris.light.json +394 -0
- package/dist/json/loft.dark.json +423 -0
- package/dist/json/loft.light.json +423 -0
- package/dist/json/orbit.dark.json +394 -0
- package/dist/json/orbit.light.json +394 -0
- package/dist/json/paper.dark.json +394 -0
- package/dist/json/paper.light.json +394 -0
- package/dist/json/slab.dark.json +412 -0
- package/dist/json/slab.light.json +412 -0
- package/dist/json/void.dark.json +394 -0
- package/dist/json/void.light.json +394 -0
- package/dist/knobs.css +21 -0
- package/dist/knobs.json +362 -0
- package/dist/knobs.min.css +1 -0
- package/dist/layers.css +2 -0
- package/dist/layers.min.css +1 -0
- package/dist/names.d.ts +519 -0
- package/dist/names.js +719 -0
- package/dist/patterns/app-shell.css +136 -0
- package/dist/patterns/app-shell.min.css +1 -0
- package/dist/patterns/data.css +430 -0
- package/dist/patterns/data.min.css +1 -0
- package/dist/patterns/media.css +288 -0
- package/dist/patterns/media.min.css +1 -0
- package/dist/patterns/page.css +323 -0
- package/dist/patterns/page.min.css +1 -0
- package/dist/patterns/shell.css +328 -0
- package/dist/patterns/shell.min.css +1 -0
- package/dist/primitives.css +175 -0
- package/dist/primitives.min.css +1 -0
- package/dist/reset.css +44 -0
- package/dist/reset.min.css +1 -0
- package/dist/skin.d.ts +14 -0
- package/dist/skin.js +158 -0
- package/dist/skins/loft.css +94 -0
- package/dist/skins/loft.min.css +1 -0
- package/dist/skins/slab.css +99 -0
- package/dist/skins/slab.min.css +1 -0
- package/dist/themes/aurora.css +18 -0
- package/dist/themes/aurora.min.css +1 -0
- package/dist/themes/capsule.css +18 -0
- package/dist/themes/capsule.min.css +1 -0
- package/dist/themes/console.css +18 -0
- package/dist/themes/console.min.css +1 -0
- package/dist/themes/dune.css +18 -0
- package/dist/themes/dune.min.css +1 -0
- package/dist/themes/iris.css +18 -0
- package/dist/themes/iris.min.css +1 -0
- package/dist/themes/orbit.css +18 -0
- package/dist/themes/orbit.min.css +1 -0
- package/dist/themes/paper.css +19 -0
- package/dist/themes/paper.min.css +1 -0
- package/dist/themes/void.css +18 -0
- package/dist/themes/void.min.css +1 -0
- package/dist/tokens.css +695 -0
- package/dist/tokens.min.css +1 -0
- package/dist/type.css +99 -0
- package/dist/type.min.css +1 -0
- package/dist/void.css +9673 -0
- package/dist/void.min.css +1 -0
- 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 +10 -3
- 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 +25 -15
- 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 +35 -23
- 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 +10 -10
- 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 +56 -79
- 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 -77
- 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 +19 -97
- 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/README.md
CHANGED
|
@@ -10,32 +10,157 @@ npm install @voidable/theme
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
Import the full theme (
|
|
13
|
+
Import the full theme (tokens, scoped reset, and all component styles):
|
|
14
14
|
|
|
15
15
|
```css
|
|
16
16
|
@import '@voidable/theme';
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Or import
|
|
19
|
+
Or import parts of it, or one component at a time (always with the tokens):
|
|
20
20
|
|
|
21
21
|
```css
|
|
22
|
-
@import '@voidable/theme/primitives';
|
|
23
22
|
@import '@voidable/theme/tokens';
|
|
24
|
-
@import '@voidable/theme/
|
|
23
|
+
@import '@voidable/theme/base'; /* html and body; in the full theme already */
|
|
24
|
+
@import '@voidable/theme/components/button.css';
|
|
25
|
+
@import '@voidable/theme/patterns/page.css';
|
|
25
26
|
```
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
Without a bundler, link the built file directly:
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
```html
|
|
31
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@voidable/theme/dist/void.min.css" />
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Everything is in named cascade layers (`components.void.reset`, `components.void.tokens`, `components.void.components` and so on), so an unlayered rule in your app overrides the theme without `!important`. See Theming on the docs site.
|
|
35
|
+
|
|
36
|
+
In a JavaScript entry point processed by a bundler (for example Vite), `import '@voidable/theme';` also works.
|
|
37
|
+
|
|
38
|
+
## Before components load
|
|
39
|
+
|
|
40
|
+
Until a component's script has loaded, its tag is an unknown element and the page can flash or jump. `src/pre-upgrade.css`, part of the main entry, styles the not-yet-defined state with `:not(:defined)` rules: closed overlays, inactive tab panels and option lists stay hidden, and the space of inputs, selects, tab lists and similar is reserved. The rules stop applying when the element is defined. See [Loading components](https://voidable.dev/getting-started/loading/#before-a-component-loads).
|
|
41
|
+
|
|
42
|
+
## Dark and light
|
|
43
|
+
|
|
44
|
+
There is no fixed default scheme. With no `data-theme`, the page follows the operating system (`prefers-color-scheme`; dark where the browser cannot say), unless a theme or skin states a preferred scheme (Loft and Slab prefer light), which then wins over the operating system. Set the `data-theme` attribute on `<html>`, or on any element, to choose a scheme explicitly: `dark` or `light` always win, and `system` follows the operating system even over a theme or skin's preference. Dark is a true black page, light a true white one.
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<html data-theme="light">
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Retheming: the knobs
|
|
51
|
+
|
|
52
|
+
The whole theme is derived from about a dozen inputs, in plain CSS, in both colour schemes. To retheme, set knobs; do not edit individual tokens.
|
|
53
|
+
|
|
54
|
+
```css
|
|
55
|
+
:root {
|
|
56
|
+
--void-accent-hue: 250; /* OKLCH hue in degrees */
|
|
57
|
+
--void-accent-chroma: 0.16; /* 0 = monochrome (default) */
|
|
58
|
+
--void-radius: 8px;
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
| Knob | Default | Changes |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| `--void-accent-hue`, `--void-accent-chroma` | `250`, `0` | Accent colour. Chroma 0 is no accent: primary actions are the inverse of the page |
|
|
65
|
+
| `--void-neutral-hue`, `--void-neutral-chroma` | `60`, `0.004` | Tint of text, borders and surfaces |
|
|
66
|
+
| `--void-page-tint` | `0` | 0 is a pure black or white page; 1 is a soft, tinted page |
|
|
67
|
+
| `--void-contrast` | `0.2` | Strength of secondary text and control borders, 0 to 1. Never below WCAG AA |
|
|
68
|
+
| `--void-chrome` | `0.3` | Strength of divider lines and container fills, 0 to 1 |
|
|
69
|
+
| `--void-radius` | `4px` | Corner radius of a control; other radii scale from it |
|
|
70
|
+
| `--void-density` | `1` | Control height (36px at 1), padding and the spacing scale |
|
|
71
|
+
| `--void-rhythm` | `1` | Space between groups and sections |
|
|
72
|
+
| `--void-font-size` | `0.875rem` | Body text size; other sizes scale from it |
|
|
73
|
+
| `--void-font-sans`, `--void-font-mono` | Inter, JetBrains Mono | Typefaces (no font files are shipped) |
|
|
74
|
+
| `--void-anim-scale` | `1` | Multiplies every duration; 0 is off |
|
|
75
|
+
|
|
76
|
+
They are documented in full in [`src/knobs.css`](./src/knobs.css).
|
|
77
|
+
|
|
78
|
+
### Themes
|
|
79
|
+
|
|
80
|
+
Turn them on a real application in the [theme builder](https://voidable.dev/theme/) and copy the result. A link to the builder is a theme: every knob is a query parameter named after it without `--void-` (`https://voidable.dev/theme/?accent-hue=162&accent-chroma=0.19&radius=8`).
|
|
81
|
+
|
|
82
|
+
A theme is a file that sets knobs and nothing else. Eight ship, each about a dozen lines: `void` (the default), `dune` (warm, rounded, comfortable), `console` (dense, sharp, monospace), `orbit` (monochrome, very airy), `capsule` (pill controls), `aurora` (a vivid green accent), `iris` (violet, on a tinted page) and `paper` (a serif, editorial).
|
|
83
|
+
|
|
84
|
+
### Skins
|
|
85
|
+
|
|
86
|
+
A skin changes structure, which knobs cannot. It is one rule of token assignments and combines with any theme and any knobs. Two ship: `loft` is soft and elevated (a tinted page, white cards with shadows, no hairlines); `slab` is dense, square and ruled (heavy ink lines, framed boxes with hard offset shadows, an inverted current link). Both prefer the light scheme; `data-theme` still decides when it is set.
|
|
87
|
+
|
|
88
|
+
```css
|
|
89
|
+
@import '@voidable/theme';
|
|
90
|
+
@import '@voidable/theme/skins/loft.css';
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
```html
|
|
94
|
+
<html data-void-skin="loft">
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
To write your own, see [Build a skin](https://voidable.dev/getting-started/skins/): one `[data-void-skin="mine"] { … }` rule, expanded for nested regions with `expandSkin()` from `@voidable/theme/skin`.
|
|
98
|
+
|
|
99
|
+
### Component tokens
|
|
100
|
+
|
|
101
|
+
Below the knobs and the derived semantic tokens sit **component tokens**: per-component override points named `--void-<component>-<part?>-<property>-<state?>`, each defaulting to a semantic or role token. The theme never declares them, so one declaration wins anywhere, with no `!important`:
|
|
102
|
+
|
|
103
|
+
```css
|
|
104
|
+
:root { --void-card-shadow: var(--void-shadow-sm); } /* every card */
|
|
105
|
+
.billing { --void-card-radius: 0; } /* the cards of one region */
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Role tokens restyle a whole kind of component: `--void-container-*`, `--void-float-*`, `--void-control-*`, `--void-field-*`, `--void-item-*-selected` and the `--void-rule*` lines. The full list with defaults is in the [theming guide](https://voidable.dev/getting-started/theming/#component-token-reference) and in `@voidable/theme/component-tokens.json`.
|
|
109
|
+
|
|
110
|
+
### Tokens as data
|
|
111
|
+
|
|
112
|
+
Every token, resolved for each theme and skin in both colour schemes, for tools that cannot run CSS:
|
|
113
|
+
|
|
114
|
+
| Import | Contents |
|
|
115
|
+
|---|---|
|
|
116
|
+
| `@voidable/theme/dtcg/<theme>.<scheme>.tokens.json` | [Design Tokens Community Group](https://www.designtokens.org/TR/2025.10/format/) format, Format Module 2025.10 (Tokens Studio, Style Dictionary) |
|
|
117
|
+
| `@voidable/theme/dtcg/voidable.resolver.json` | A DTCG resolver document listing those files |
|
|
118
|
+
| `@voidable/theme/json/<theme>.<scheme>.json` | `{ "--void-color-bg": "#000000", ... }`: custom property to resolved CSS value |
|
|
119
|
+
| `@voidable/theme/knobs.json` | The knobs as data: range, step, unit, default, description, and each shipped theme's values |
|
|
120
|
+
| `@voidable/theme/component-tokens.json` | Component tokens grouped by component (name, default, what it styles), the role tokens and the naming vocabulary |
|
|
121
|
+
| `@voidable/theme/names` | `tokenNames`, `roleTokenNames`, `componentTokenNames`, `componentTokens`, `knobNames`, `themeNames`, `skinNames`, `cssVar()`, and the types `TokenName`, `RoleTokenName`, `ComponentTokenName`, `KnobName`, `ThemeName`, `SkinName` |
|
|
122
|
+
| `@voidable/theme/skin` | `expandSkin(css, name)`: a skin source written out for every scope of the theme |
|
|
123
|
+
|
|
124
|
+
`<theme>` is a theme or skin name, `<scheme>` is `dark` or `light`: `@voidable/theme/dtcg/dune.light.tokens.json`. The values are computed at build time and tested to equal what Chromium computes from the CSS.
|
|
125
|
+
|
|
126
|
+
```css
|
|
127
|
+
@import '@voidable/theme';
|
|
128
|
+
@import '@voidable/theme/themes/dune.css';
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
```html
|
|
132
|
+
<html data-void-theme="dune">
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Part of a page
|
|
136
|
+
|
|
137
|
+
Knobs take effect on `:root` and on any element that carries `data-void-theme` (named or empty):
|
|
138
|
+
|
|
139
|
+
```html
|
|
140
|
+
<section data-void-theme style="--void-radius: 0px">…</section>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
A knob set on an element without that attribute changes nothing below it, because the derived tokens are only recomputed on `:root`, `[data-theme]`, `[data-void-theme]` and `[data-shape]`.
|
|
144
|
+
|
|
145
|
+
### Type roles
|
|
146
|
+
|
|
147
|
+
`data-void-type` applies a named text role: `label`, `value`, `unit`, `caption`, `heading`, `title`, `display`, `lede`, `body`, `code`. Components use the same `--void-type-<role>-*` tokens, so restyling a role restyles it everywhere.
|
|
30
148
|
|
|
31
149
|
```html
|
|
32
|
-
<
|
|
150
|
+
<span data-void-type="label">Uptime</span>
|
|
151
|
+
<span data-void-type="value">99.98</span> <span data-void-type="unit">%</span>
|
|
33
152
|
```
|
|
34
153
|
|
|
154
|
+
### Browser support
|
|
155
|
+
|
|
156
|
+
`oklch()`, `color-mix()` and `calc()` inside both: Chrome 111, Firefox 113, Safari 16.2.
|
|
157
|
+
|
|
35
158
|
## Documentation
|
|
36
159
|
|
|
37
|
-
- [
|
|
160
|
+
- [Docs](https://voidable.dev)
|
|
161
|
+
- [Storybook](https://voidable.dev/storybook/)
|
|
38
162
|
- [GitHub](https://github.com/VoidableUI/Voidable)
|
|
163
|
+
- [npm](https://www.npmjs.com/package/@voidable/theme)
|
|
39
164
|
|
|
40
165
|
## License
|
|
41
166
|
|
package/dist/base.css
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@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;
|
|
2
|
+
|
|
3
|
+
@layer components.void.reset {
|
|
4
|
+
html {
|
|
5
|
+
color-scheme: var(--void-color-scheme);
|
|
6
|
+
-webkit-font-smoothing: antialiased;
|
|
7
|
+
-moz-osx-font-smoothing: grayscale;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
body {
|
|
11
|
+
font-family: var(--void-type-body-family);
|
|
12
|
+
font-size: var(--void-type-body-size);
|
|
13
|
+
line-height: var(--void-type-body-leading);
|
|
14
|
+
font-weight: var(--void-type-body-weight);
|
|
15
|
+
color: var(--void-type-body-color);
|
|
16
|
+
background: var(--void-color-bg);
|
|
17
|
+
margin: 0;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@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;@layer components.void.reset{html{color-scheme:var(--void-color-scheme);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{font-family:var(--void-type-body-family);font-size:var(--void-type-body-size);line-height:var(--void-type-body-leading);font-weight:var(--void-type-body-weight);color:var(--void-type-body-color);background:var(--void-color-bg);margin:0}}
|