@mitcsutt/kiln-ui 0.2.2 → 0.3.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 +6 -6
- package/dist/assets/fonts/archivo-latin-ext-wdth-italic.woff2 +0 -0
- package/dist/assets/fonts/archivo-latin-ext-wdth-normal.woff2 +0 -0
- package/dist/assets/fonts/archivo-latin-wdth-italic.woff2 +0 -0
- package/dist/assets/fonts/archivo-latin-wdth-normal.woff2 +0 -0
- package/dist/assets/fonts/atkinson-hyperlegible-mono-latin-ext-wght-italic.woff2 +0 -0
- package/dist/assets/fonts/atkinson-hyperlegible-mono-latin-ext-wght-normal.woff2 +0 -0
- package/dist/assets/fonts/atkinson-hyperlegible-mono-latin-wght-italic.woff2 +0 -0
- package/dist/assets/fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2 +0 -0
- package/dist/assets/fonts/b612-latin-400-italic.woff2 +0 -0
- package/dist/assets/fonts/b612-latin-400-normal.woff2 +0 -0
- package/dist/assets/fonts/b612-latin-700-italic.woff2 +0 -0
- package/dist/assets/fonts/b612-latin-700-normal.woff2 +0 -0
- package/dist/assets/fonts/b612-mono-latin-400-italic.woff2 +0 -0
- package/dist/assets/fonts/b612-mono-latin-400-normal.woff2 +0 -0
- package/dist/assets/fonts/b612-mono-latin-700-italic.woff2 +0 -0
- package/dist/assets/fonts/b612-mono-latin-700-normal.woff2 +0 -0
- package/dist/assets/fonts/golos-text-latin-ext-wght-normal.woff2 +0 -0
- package/dist/assets/fonts/golos-text-latin-wght-normal.woff2 +0 -0
- package/dist/assets/fonts/licenses/archivo.txt +93 -0
- package/dist/assets/fonts/licenses/atkinson-hyperlegible-mono.txt +93 -0
- package/dist/assets/fonts/licenses/b612-mono.txt +93 -0
- package/dist/assets/fonts/licenses/b612.txt +93 -0
- package/dist/assets/fonts/licenses/golos-text.txt +93 -0
- package/dist/assets/fonts/licenses/shantell-sans.txt +93 -0
- package/dist/assets/fonts/shantell-sans-latin-ext-full-italic.woff2 +0 -0
- package/dist/assets/fonts/shantell-sans-latin-ext-full-normal.woff2 +0 -0
- package/dist/assets/fonts/shantell-sans-latin-full-italic.woff2 +0 -0
- package/dist/assets/fonts/shantell-sans-latin-full-normal.woff2 +0 -0
- package/dist/components/display/Avatar/Avatar.d.ts +3 -3
- package/dist/components/display/Avatar/Avatar.js.map +1 -1
- package/dist/icons/Icon.d.ts +1 -1
- package/dist/icons/Icon.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme/ThemeProvider.d.ts +4 -4
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/themes.d.ts +1 -1
- package/dist/theme/themes.js +15 -3
- package/dist/theme/themes.js.map +1 -1
- package/dist/themes/fiesta.css +1 -1
- package/dist/themes/flightdeck.css +1 -0
- package/dist/themes/ledger.css +1 -1
- package/dist/themes/monograph.css +1 -1
- package/dist/themes/riso.css +1 -0
- package/package.json +4 -2
- package/skills/custom-theme/SKILL.md +45 -43
- package/skills/custom-theme/references/colour.md +1 -1
- package/skills/custom-theme/references/motion.md +2 -2
- package/skills/custom-theme/references/tokens.md +42 -42
- package/skills/custom-theme/references/type.md +13 -10
- package/skills/design-rules/SKILL.md +31 -3
- package/skills/setup-and-theming/SKILL.md +10 -6
- package/skills/setup-and-theming/references/fiesta.md +3 -1
- package/skills/setup-and-theming/references/flightdeck.md +39 -0
- package/skills/setup-and-theming/references/ledger.md +7 -7
- package/skills/setup-and-theming/references/monograph.md +4 -0
- package/skills/setup-and-theming/references/paper.md +7 -7
- package/skills/setup-and-theming/references/riso.md +32 -0
|
@@ -45,25 +45,25 @@ Type roles:
|
|
|
45
45
|
|
|
46
46
|
| Token | Paper |
|
|
47
47
|
| --- | --- |
|
|
48
|
-
| `--font-display` | `'
|
|
49
|
-
| `--font-text` | `'
|
|
50
|
-
| `--font-prose` | `'
|
|
51
|
-
| `--font-mono` | `'
|
|
52
|
-
| `--font-numeric` | `'
|
|
48
|
+
| `--font-display` | `'Golos Text', ui-sans-serif, system-ui, sans-serif` |
|
|
49
|
+
| `--font-text` | `'Golos Text', ui-sans-serif, system-ui, sans-serif` |
|
|
50
|
+
| `--font-prose` | `'Golos Text', ui-sans-serif, system-ui, sans-serif` |
|
|
51
|
+
| `--font-mono` | `'Atkinson Hyperlegible Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace` |
|
|
52
|
+
| `--font-numeric` | `'Golos Text', ui-sans-serif, system-ui, sans-serif` |
|
|
53
53
|
| `--type-base` | `1rem` |
|
|
54
54
|
| `--display-scale` | `1` |
|
|
55
55
|
| `--type-ratio` | `1.25` |
|
|
56
|
-
| `--display-weight` | `
|
|
56
|
+
| `--display-weight` | `740` |
|
|
57
57
|
| `--display-style` | `normal` |
|
|
58
58
|
| `--display-stretch` | `100%` |
|
|
59
59
|
| `--display-transform` | `none` |
|
|
60
|
-
| `--display-tracking` | `-0.
|
|
60
|
+
| `--display-tracking` | `-0.025em` |
|
|
61
61
|
| `--display-opsz` | `72` |
|
|
62
62
|
| `--heading-font` | `var(--font-display)` |
|
|
63
|
-
| `--heading-weight` | `
|
|
63
|
+
| `--heading-weight` | `650` |
|
|
64
64
|
| `--heading-tracking` | `-0.015em` |
|
|
65
65
|
| `--heading-transform` | `none` |
|
|
66
|
-
| `--label-weight` | `
|
|
66
|
+
| `--label-weight` | `600` |
|
|
67
67
|
| `--label-tracking` | `0` |
|
|
68
68
|
| `--label-transform` | `none` |
|
|
69
69
|
| `--numeric-stretch` | `100%` |
|
|
@@ -71,7 +71,7 @@ Type roles:
|
|
|
71
71
|
| `--leading-tight` | `1` |
|
|
72
72
|
| `--leading-snug` | `1.2` |
|
|
73
73
|
| `--leading-body` | `1.55` |
|
|
74
|
-
| `--prose-size` | `1.
|
|
74
|
+
| `--prose-size` | `1.0625rem` |
|
|
75
75
|
| `--prose-leading` | `1.6` |
|
|
76
76
|
|
|
77
77
|
Structure & temperament:
|
|
@@ -86,38 +86,38 @@ Structure & temperament:
|
|
|
86
86
|
| `--icon-stroke` | `1.5` |
|
|
87
87
|
| `--border-width` | `1px` |
|
|
88
88
|
| `--border-width-strong` | `2px` |
|
|
89
|
-
| `--radius-action` | `0.
|
|
90
|
-
| `--radius-field` | `0.
|
|
91
|
-
| `--radius-surface` | `0.
|
|
92
|
-
| `--radius-media` | `0.
|
|
93
|
-
| `--radius-chip` | `
|
|
89
|
+
| `--radius-action` | `0.25rem` |
|
|
90
|
+
| `--radius-field` | `0.25rem` |
|
|
91
|
+
| `--radius-surface` | `0.375rem` |
|
|
92
|
+
| `--radius-media` | `0.125rem` |
|
|
93
|
+
| `--radius-chip` | `999px` |
|
|
94
94
|
| `--radius-avatar` | `50%` |
|
|
95
95
|
|
|
96
96
|
Colour:
|
|
97
97
|
|
|
98
98
|
| Token | Paper |
|
|
99
99
|
| --- | --- |
|
|
100
|
-
| `--color-canvas` | `light-dark(oklch(0.
|
|
101
|
-
| `--color-surface` | `light-dark(oklch(0.
|
|
102
|
-
| `--color-surface-sunken` | `light-dark(oklch(0.
|
|
103
|
-
| `--color-surface-raised` | `light-dark(oklch(0.
|
|
104
|
-
| `--color-surface-inverse` | `light-dark(oklch(0.
|
|
105
|
-
| `--color-ink` | `light-dark(oklch(0.
|
|
106
|
-
| `--color-ink-muted` | `light-dark(oklch(0.
|
|
107
|
-
| `--color-ink-subtle` | `light-dark(oklch(0.
|
|
108
|
-
| `--color-ink-inverse` | `light-dark(oklch(0.
|
|
109
|
-
| `--color-line` | `light-dark(oklch(0.9 0.
|
|
110
|
-
| `--color-line-strong` | `light-dark(oklch(0.
|
|
111
|
-
| `--color-accent` | `light-dark(oklch(0.
|
|
112
|
-
| `--color-accent-hover` | `light-dark(oklch(0.
|
|
113
|
-
| `--color-accent-ink` | `light-dark(oklch(0.
|
|
114
|
-
| `--color-accent-text` | `light-dark(oklch(0.
|
|
115
|
-
| `--color-accent-soft` | `light-dark(oklch(0.
|
|
116
|
-
| `--color-highlight` | `light-dark(oklch(0.
|
|
100
|
+
| `--color-canvas` | `light-dark(oklch(0.952 0.006 250), oklch(0.17 0.008 250))` |
|
|
101
|
+
| `--color-surface` | `light-dark(oklch(0.995 0.002 250), oklch(0.215 0.009 250))` |
|
|
102
|
+
| `--color-surface-sunken` | `light-dark(oklch(0.935 0.006 250), oklch(0.14 0.008 250))` |
|
|
103
|
+
| `--color-surface-raised` | `light-dark(oklch(0.998 0.002 250), oklch(0.25 0.009 250))` |
|
|
104
|
+
| `--color-surface-inverse` | `light-dark(oklch(0.26 0.06 256), oklch(0.93 0.012 250))` |
|
|
105
|
+
| `--color-ink` | `light-dark(oklch(0.26 0.06 256), oklch(0.94 0.01 250))` |
|
|
106
|
+
| `--color-ink-muted` | `light-dark(oklch(0.42 0.06 256), oklch(0.77 0.015 250))` |
|
|
107
|
+
| `--color-ink-subtle` | `light-dark(oklch(0.47 0.06 256), oklch(0.66 0.015 250))` |
|
|
108
|
+
| `--color-ink-inverse` | `light-dark(oklch(0.96 0.006 250), oklch(0.2 0.05 256))` |
|
|
109
|
+
| `--color-line` | `light-dark(oklch(0.9 0.006 250), oklch(0.3 0.01 250))` |
|
|
110
|
+
| `--color-line-strong` | `light-dark(oklch(0.78 0.012 252), oklch(0.42 0.012 250))` |
|
|
111
|
+
| `--color-accent` | `light-dark(oklch(0.37 0.1 255), oklch(0.86 0.06 250))` |
|
|
112
|
+
| `--color-accent-hover` | `light-dark(oklch(0.31 0.095 255), oklch(0.92 0.045 250))` |
|
|
113
|
+
| `--color-accent-ink` | `light-dark(oklch(0.985 0.005 250), oklch(0.2 0.05 256))` |
|
|
114
|
+
| `--color-accent-text` | `light-dark(oklch(0.35 0.1 255), oklch(0.86 0.06 250))` |
|
|
115
|
+
| `--color-accent-soft` | `light-dark(oklch(0.93 0.025 252), oklch(0.285 0.03 252))` |
|
|
116
|
+
| `--color-highlight` | `light-dark(oklch(0.925 0.045 228), oklch(0.33 0.05 235))` |
|
|
117
117
|
| `--color-highlight-ink` | `var(--color-ink)` |
|
|
118
118
|
| `--color-focus` | `var(--color-ink)` |
|
|
119
119
|
| `--color-selection` | `light-dark(oklch(0.88 0.06 228), oklch(0.42 0.07 235))` |
|
|
120
|
-
| `--color-scrim` | `light-dark(oklch(0.22 0.
|
|
120
|
+
| `--color-scrim` | `light-dark(oklch(0.22 0.04 258 / 0.4), oklch(0.07 0.01 250 / 0.66))` |
|
|
121
121
|
| `--tone-positive` | `light-dark(oklch(0.52 0.11 155), oklch(0.72 0.12 158))` |
|
|
122
122
|
| `--tone-positive-soft` | `light-dark(oklch(0.94 0.035 155), oklch(0.28 0.045 158))` |
|
|
123
123
|
| `--tone-positive-text` | `light-dark(oklch(0.45 0.1 155), oklch(0.78 0.11 158))` |
|
|
@@ -141,8 +141,8 @@ Colour:
|
|
|
141
141
|
| `--color-cat-5` | `light-dark(oklch(0.8 0.05 300), oklch(0.7 0.06 300))` |
|
|
142
142
|
| `--color-cat-6` | `light-dark(oklch(0.82 0.06 125), oklch(0.72 0.07 125))` |
|
|
143
143
|
| `--color-cat-7` | `light-dark(oklch(0.8 0.05 195), oklch(0.7 0.06 195))` |
|
|
144
|
-
| `--color-cat-8` | `light-dark(oklch(0.8 0.01
|
|
145
|
-
| `--color-cat-ink` | `oklch(0.21 0.
|
|
144
|
+
| `--color-cat-8` | `light-dark(oklch(0.8 0.01 250), oklch(0.7 0.01 250))` |
|
|
145
|
+
| `--color-cat-ink` | `oklch(0.21 0.03 258)` |
|
|
146
146
|
|
|
147
147
|
Edges & depth:
|
|
148
148
|
|
|
@@ -151,13 +151,13 @@ Edges & depth:
|
|
|
151
151
|
| `--shadow-surface` | `none` |
|
|
152
152
|
| `--active-shift` | `0px` |
|
|
153
153
|
| `--shadow-active` | `none` |
|
|
154
|
-
| `--shadow-float` | `0 1px 2px oklch(0.2 0.
|
|
155
|
-
| `--shadow-overlay` | `0 2px 4px oklch(0.15 0.
|
|
154
|
+
| `--shadow-float` | `0 1px 2px oklch(0.2 0.04 258 / 0.1), 0 8px 24px -6px oklch(0.2 0.04 258 / 0.18)` |
|
|
155
|
+
| `--shadow-overlay` | `0 2px 4px oklch(0.15 0.04 258 / 0.12), 0 20px 56px -12px oklch(0.15 0.04 258 / 0.32)` |
|
|
156
156
|
| `--canvas-image` | `none` |
|
|
157
157
|
|
|
158
158
|
## Optional theme tokens
|
|
159
159
|
|
|
160
|
-
Some themes set a few more: Fiesta's inks for text on
|
|
160
|
+
Some themes set a few more: Fiesta's and Riso's inks for text on their tinted rows, Ledger's table rule. Every theme scope resets these first, so a theme nested inside another falls back to the component's default instead of inheriting its parent's value. Set them only when your theme's idea needs them:
|
|
161
161
|
|
|
162
162
|
`--canvas-image-size`, `--control-checked-border`, `--highlight-accent-text`, `--highlight-tone-caution-text`, `--highlight-tone-critical-text`, `--highlight-tone-info-text`, `--highlight-tone-positive-text`, `--marquee-edge`, `--numeral-scale`, `--numeral-weight`, `--section-divider-color`, `--stat-fit`, `--table-foot-rule`, `--table-head-font`
|
|
163
163
|
|
|
@@ -170,7 +170,7 @@ A component exposes a few tokens of its own where a theme might reasonably diffe
|
|
|
170
170
|
Radii are roles, not one global roundness. A theme can make actions pills and surfaces square.
|
|
171
171
|
|
|
172
172
|
|
|
173
|
-
One edge treatment per element: a border, a shadow or a change of fill, never all three. Static structure uses hairlines. Soft shadows are only for things that float, like popovers and dialogs. Fiesta
|
|
173
|
+
One edge treatment per element: a border, a shadow or a change of fill, never all three. Static structure uses hairlines. Soft shadows are only for things that float, like popovers and dialogs. Hard offsets never go on static surfaces in a new theme. Fiesta keeps its hard offset as a legacy preset: it's the print misregistration, and it _is_ the edge. Riso's misregistered offset, the second ink drum printing slightly off, is floating-only.
|
|
174
174
|
|
|
175
175
|
|
|
176
176
|
## Axes and scoping
|
|
@@ -178,13 +178,13 @@ One edge treatment per element: a border, a shadow or a change of fill, never al
|
|
|
178
178
|
Three attributes select tokens, and they're independent of each other.
|
|
179
179
|
|
|
180
180
|
```html
|
|
181
|
-
<html data-theme="
|
|
182
|
-
<div data-theme="
|
|
181
|
+
<html data-theme="flightdeck" data-mode="dark">
|
|
182
|
+
<div data-theme="riso">a Riso panel that keeps the page's dark mode</div>
|
|
183
183
|
<div data-density="compact">a denser table</div>
|
|
184
184
|
</html>
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
-
- `data-theme` is `paper`, `monograph`, `ledger`, `fiesta`, or the name of a theme you wrote. No attribute means Paper.
|
|
187
|
+
- `data-theme` is `paper`, `monograph`, `ledger`, `fiesta`, `flightdeck`, `riso`, or the name of a theme you wrote. No attribute means Paper.
|
|
188
188
|
- `data-mode` is `light`, `dark` or `system`. It drives `color-scheme`, which drives every `light-dark()` colour. Leave it off nested scopes and they inherit the page's mode.
|
|
189
189
|
- `data-density` is `compact` or `comfortable`, and multiplies the theme's own density.
|
|
190
190
|
|
|
@@ -20,7 +20,7 @@ A theme picks at most two families (plus a mono where it needs one) and assigns
|
|
|
20
20
|
| Numeric | `--font-numeric`, `--numeric-stretch` | `Numeral`, `Amount`, `Stat`, numeric cells |
|
|
21
21
|
| Mono | `--font-mono`, `--mono-stretch` | `Code`, `CodeBlock`, `Kbd` |
|
|
22
22
|
|
|
23
|
-
Fiesta sets `--heading-transform: uppercase` for poster headlines
|
|
23
|
+
Fiesta sets `--heading-transform: uppercase` for poster headlines. Ledger sets `--numeric-stretch` so its figures use a condensed width of the same family, and a column of money reads like receipt tape. Flightdeck keeps its numerals in B612, whose digits are already equal width, so columns align without a monospace. Neither needed a component change. Riso's Shantell Sans has no tabular figures, so its numerals don't line up in columns.
|
|
24
24
|
|
|
25
25
|
## The scale
|
|
26
26
|
|
|
@@ -50,12 +50,15 @@ Every number that aligns or updates uses tabular, lining figures: counts, money,
|
|
|
50
50
|
|
|
51
51
|
Kiln self-hosts every face its themes use, so there's nothing to set up:
|
|
52
52
|
|
|
53
|
-
| Face
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
| Face | Used by | Ships in |
|
|
54
|
+
| ---------------------------------- | ------------------------------- | ------------------------------------------- |
|
|
55
|
+
| Golos Text | Paper | `styles.css` |
|
|
56
|
+
| Atkinson Hyperlegible Mono | code in Paper, Ledger and Riso | `styles.css` |
|
|
57
|
+
| Newsreader, Schibsted Grotesk | Monograph | `themes/monograph.css` |
|
|
58
|
+
| Martian Mono | code in Monograph and Fiesta | `themes/monograph.css`, `themes/fiesta.css` |
|
|
59
|
+
| Archivo | Ledger | `themes/ledger.css` |
|
|
60
|
+
| Big Shoulders, Bricolage Grotesque | Fiesta | `themes/fiesta.css` |
|
|
61
|
+
| B612, B612 Mono | Flightdeck (B612 Mono for code) | `themes/flightdeck.css` |
|
|
62
|
+
| Shantell Sans | Riso | `themes/riso.css` |
|
|
63
|
+
|
|
64
|
+
Browsers download a face only when something renders in it, so a declared face you never use costs nothing. All of them are licensed under the SIL Open Font License 1.1, and the licences ship in the package at `dist/assets/fonts/licenses/`. A theme of your own loads its own fonts: see [Theming](../SKILL.md#5-load-its-fonts).
|
|
@@ -20,7 +20,7 @@ These rules come from [DESIGN.md](https://github.com/mitcsutt/kiln/blob/main/DES
|
|
|
20
20
|
## Principles
|
|
21
21
|
|
|
22
22
|
1. **Themes are data, components are structure.** A component never knows which theme it is in. Everything visual is a token; a new theme is one CSS file and zero component changes.
|
|
23
|
-
2. **One idea per theme, drawn from its subject.** Paper is
|
|
23
|
+
2. **One idea per theme, drawn from its subject.** Paper is an office that prints for everyone, on grey recycled stock in blue-black ink. Monograph is a scholar's monograph read under a desk lamp. Ledger is an accountant's columnar pad. Fiesta is a screen-printed festival poster. Flightdeck is a glass-cockpit display. Riso is a two-drum risograph zine. Monograph and Fiesta predate the second-order rules in §2 and are kept unchanged for compatibility. Every choice in a theme designed since has a one-line reason traced to its subject, written in the stylesheet next to the value. If you can't write the reason, the choice is wrong and it doesn't ship.
|
|
24
24
|
3. **Props, not styles.** Consumers compose layout and intent through typed props (`gap={5}`, `tone="critical"`, `width="text"`). No utility classes, no inline style soup, no raw px/hex/ms at call sites. `className` exists as an escape hatch, not a workflow.
|
|
25
25
|
4. **Durable by default.** Every component forwards refs, spreads native props, works with React 18 and 19, is keyboard- and screen-reader-complete, respects `prefers-reduced-motion`, and renders on the server.
|
|
26
26
|
5. **Specific beats safe.** The median choice is the wrong choice (see [Not AI slop](#not-ai-slop)).
|
|
@@ -34,7 +34,7 @@ Generated UI converges on the statistical median: indigo buttons, Inter, gradien
|
|
|
34
34
|
- Authored in **OKLCH**. Neutrals are **tinted** (chroma 0.004–0.02 toward the theme's hue). Never `#000`/`#fff` surfaces, never stock slate/zinc.
|
|
35
35
|
- **One accent, ~5–10% of pixels**: the primary action, the current item, live state, key data. A second hue only when it carries meaning (`--color-highlight` = "you" / selected; tones = status).
|
|
36
36
|
- **No gradients** unless they encode data. No gradient text. No glow halos in dark mode.
|
|
37
|
-
- No indigo/violet as a primary. No cream `#F4F1EA`
|
|
37
|
+
- No indigo/violet as a primary. No warm cream canvas (such as `#F4F1EA`) and no terracotta or ember accent (such as `#D97757`). See _Second-order tells_ below.
|
|
38
38
|
|
|
39
39
|
### Type
|
|
40
40
|
|
|
@@ -44,6 +44,34 @@ Generated UI converges on the statistical median: indigo buttons, Inter, gradien
|
|
|
44
44
|
- Prose measure ≤ 70ch (`width="text"`). `text-wrap: balance` on headings, `pretty` on paragraphs (the reset does it).
|
|
45
45
|
- **Banned patterns:** accenting one word of a headline in italic/colour; a tracked ALL-CAPS eyebrow over every section; `01 / 02 / 03` numbering on things that aren't a sequence; monospace used as decoration for small labels.
|
|
46
46
|
|
|
47
|
+
### Second-order tells
|
|
48
|
+
|
|
49
|
+
Models that are told to avoid the tells above converge on a second set instead ([research](https://github.com/mitcsutt/kiln/blob/main/docs/research/ai-design-tells.md), [ADR 0030](https://github.com/mitcsutt/kiln/blob/main/docs/adr/0030-theme-family-without-ai-tells.md)). None of these ships in a new built-in theme:
|
|
50
|
+
|
|
51
|
+
- A **cream or warm-paper canvas** (hue 40 to 100, with any visible chroma), including apricot and beige.
|
|
52
|
+
- An **ember, terracotta or burnt-orange accent**.
|
|
53
|
+
- A **near-black canvas with one acid or ember accent**.
|
|
54
|
+
- A **mint or sage canvas with a forest-green accent**, which is the cream tell in another hue.
|
|
55
|
+
- **Hard-offset "neo-brutalist" shadows on static surfaces.** A hard offset is allowed only where the theme's subject explains it, and only on floating layers. Fiesta, the legacy preset, keeps its hard offset on static surfaces; no new theme may.
|
|
56
|
+
- **Grain, noise or halftone** on the canvas (`--canvas-image` stays `none`).
|
|
57
|
+
- **Monospace beyond code**: for labels, eyebrows or every figure as decoration. A mono is allowed for figures only when the subject really uses one.
|
|
58
|
+
- A **serif display with one italic accent word**.
|
|
59
|
+
- A font from the banned list below.
|
|
60
|
+
|
|
61
|
+
`packages/ui/src/themes/tells.test.ts` enforces the checkable part for Paper, Ledger, Flightdeck and Riso, reading the light half of each `light-dark()` pair:
|
|
62
|
+
|
|
63
|
+
- no banned font family in their stylesheets or in any font stylesheet under `tokens/` except the legacy ones;
|
|
64
|
+
- no warm-cream canvas: `--color-canvas` fails when its lightness is above 0.85, its chroma above 0.008 and its hue 40 to 100;
|
|
65
|
+
- no ember, terracotta or indigo accent: `--color-accent` fails when its chroma is above 0.08 and its hue is 25 to 60 (ember) or above 262 up to 300 (indigo).
|
|
66
|
+
|
|
67
|
+
The rest is review.
|
|
68
|
+
|
|
69
|
+
**Legacy exemption.** Monograph and Fiesta are listed as `LEGACY` in that test and are exempt, along with the font stylesheets only they use (`fonts-monograph.css`, `fonts-fiesta.css` and `fonts-martian-mono.css`), because they ship unchanged from before these rules ([ADR 0030](https://github.com/mitcsutt/kiln/blob/main/docs/adr/0030-theme-family-without-ai-tells.md)). Monograph still has its ember accent and serif display, and Fiesta its apricot canvas and halftone. Do not treat them as precedent: a new theme gets no exemption, and a redesigned Monograph or Fiesta loses its own.
|
|
70
|
+
|
|
71
|
+
The banned font families, from the research: the first-order defaults plus the faces models now reach for as "distinctive" escapes (several are on Anthropic's own recommended list): Inter, Roboto, Open Sans, Poppins, Montserrat, Space Grotesk, Space Mono, Geist, DM Sans, DM Serif, Manrope, Plus Jakarta Sans, Outfit, Sora, Syne, Satoshi, Cabinet Grotesk, Clash Display, General Sans, Instrument Sans, Instrument Serif, Fraunces, Playfair Display, Cormorant, Lora, EB Garamond, Newsreader, Bricolage Grotesque, IBM Plex, JetBrains Mono and Fira Code. The list goes stale as model defaults move: change the list in the test and here together.
|
|
72
|
+
|
|
73
|
+
Beyond the checks, a theme has a subject, and each colour, face, radius and easing has a one-line reason in the stylesheet that traces it to that subject. Each theme also mixes radii on purpose (for example square fields with pill chips), so no theme is one uniform roundness.
|
|
74
|
+
|
|
47
75
|
### Layout
|
|
48
76
|
|
|
49
77
|
- **Left-aligned by default.** Centre is an exception (empty states, a lone CTA).
|
|
@@ -55,7 +83,7 @@ Generated UI converges on the statistical median: indigo buttons, Inter, gradien
|
|
|
55
83
|
### Components & depth
|
|
56
84
|
|
|
57
85
|
- **Radii are roles**, not a global roundness: `--radius-action`, `--radius-field`, `--radius-surface`, `--radius-media`, `--radius-chip`, `--radius-avatar`. Nested radii shrink (inner = outer − padding).
|
|
58
|
-
- **One edge treatment per element**: a border _or_ a shadow _or_ a fill change. Static structure uses hairlines; soft shadows are only for things that float (popover, menu, dialog). Fiesta
|
|
86
|
+
- **One edge treatment per element**: a border _or_ a shadow _or_ a fill change. Static structure uses hairlines; soft shadows are only for things that float (popover, menu, dialog). Hard-offset shadows never go on static surfaces in a new theme. Fiesta keeps its hard offset as a legacy preset: it is the print misregistration, and it _is_ the edge. Riso's misregistered offset (the second ink drum slightly off) is floating-only.
|
|
59
87
|
- **Icons**: the library ships ~20 glyphs on a 20px grid with a themed stroke. At most one icon per row; never an icon in a tinted chip; never emoji as UI.
|
|
60
88
|
- **No left-border-accent callouts.** Alerts are a neutral hairline frame; the tone lives only in the glyph and a short tab on the top edge (`variant="soft"` for a tinted box when it must shout).
|
|
61
89
|
- **Empty states** mark their frame with printer's crop marks, not a dashed box.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: setup-and-theming
|
|
3
|
-
description: "Use when installing @mitcsutt/kiln-ui in a React app: loading its stylesheet, wrapping the app in ThemeProvider, choosing Paper or a preset theme (Monograph, Ledger, Fiesta) and a colour mode, setting the theme before first paint with themeScript under SSR or the Next.js App Router, and passing router links through asChild."
|
|
3
|
+
description: "Use when installing @mitcsutt/kiln-ui in a React app: loading its stylesheet, wrapping the app in ThemeProvider, choosing Paper or a preset theme (Monograph, Ledger, Fiesta, Flightdeck, Riso) and a colour mode, setting the theme before first paint with themeScript under SSR or the Next.js App Router, and passing router links through asChild."
|
|
4
4
|
metadata:
|
|
5
5
|
purpose: Install kiln-ui, load its CSS, and apply a built-in theme and colour mode correctly on the client and the server.
|
|
6
6
|
type: lifecycle
|
|
@@ -11,6 +11,8 @@ sources:
|
|
|
11
11
|
- mitcsutt/kiln:apps/docs/content/docs/ui/themes/monograph.mdx
|
|
12
12
|
- mitcsutt/kiln:apps/docs/content/docs/ui/themes/ledger.mdx
|
|
13
13
|
- mitcsutt/kiln:apps/docs/content/docs/ui/themes/fiesta.mdx
|
|
14
|
+
- mitcsutt/kiln:apps/docs/content/docs/ui/themes/flightdeck.mdx
|
|
15
|
+
- mitcsutt/kiln:apps/docs/content/docs/ui/themes/riso.mdx
|
|
14
16
|
---
|
|
15
17
|
|
|
16
18
|
<!-- Generated from the Kiln docs by apps/docs/src/skills. Edit the docs pages, then run `pnpm generate:skills`. -->
|
|
@@ -54,14 +56,14 @@ With no `theme`, you get **Paper**, the neutral default. `ThemeProvider` writes
|
|
|
54
56
|
|
|
55
57
|
```tsx
|
|
56
58
|
import '@mitcsutt/kiln-ui/styles.css'
|
|
57
|
-
import '@mitcsutt/kiln-ui/themes/
|
|
59
|
+
import '@mitcsutt/kiln-ui/themes/flightdeck.css'
|
|
58
60
|
|
|
59
|
-
;<ThemeProvider theme="
|
|
61
|
+
;<ThemeProvider theme="flightdeck" defaultMode="dark">
|
|
60
62
|
…
|
|
61
63
|
</ThemeProvider>
|
|
62
64
|
```
|
|
63
65
|
|
|
64
|
-
Presets are separate files, so an app pays only for the ones it imports. [Themes](references/paper.md) shows all
|
|
66
|
+
Presets are separate files, so an app pays only for the ones it imports. [Themes](references/paper.md) shows all six, and [Theming](https://kiln.mitchellsutton.com/docs/ui/foundations/theming) shows how to write your own.
|
|
65
67
|
|
|
66
68
|
## Compose a screen
|
|
67
69
|
|
|
@@ -229,7 +231,9 @@ Merges class names, filtering falsy values.
|
|
|
229
231
|
|
|
230
232
|
Read a reference when its description matches the task:
|
|
231
233
|
|
|
232
|
-
- [Paper](references/paper.md): The neutral default.
|
|
234
|
+
- [Paper](references/paper.md): The neutral default. An office that prints for everyone, with white sheets on grey stock, blue-black ink as the accent and Golos Text for type.
|
|
233
235
|
- [Monograph](references/monograph.md): A scholarly monograph read under a desk lamp at night. Blue slate, one ember accent, a big serif display. Dark-first.
|
|
234
|
-
- [Ledger](references/ledger.md): An accountant's
|
|
236
|
+
- [Ledger](references/ledger.md): An accountant's columnar pad. A white sheet ruled in green, banknote-green actions, accounting red, and figures set condensed instead of in a monospace.
|
|
235
237
|
- [Fiesta](references/fiesta.md): A screen-printed festival poster. Flat spot inks, hard offsets, condensed signage numerals and springy motion.
|
|
238
|
+
- [Flightdeck](references/flightdeck.md): A glass-cockpit flight display. Cyan for what you set, a reverse-video box for what you select, and green, amber and red for status, set in B612. Dark-first.
|
|
239
|
+
- [Riso](references/riso.md): A two-drum risograph zine. Fluorescent pink and blue on white stock, screen tints instead of borders, and Shantell Sans.
|
|
@@ -8,6 +8,8 @@ Source: https://kiln.mitchellsutton.com/docs/ui/themes/fiesta
|
|
|
8
8
|
|
|
9
9
|
_A screen-printed festival poster and sticker album._ Screen printing can't do gradients, so neither does Fiesta: flat spot inks on apricot poster stock, everything keylined in aubergine, and a hard misregistered offset where other themes have a soft shadow.
|
|
10
10
|
|
|
11
|
+
Fiesta predates Kiln's [second-order design rules](https://kiln.mitchellsutton.com/docs/ui/foundations/design-rules#second-order-tells) and ships unchanged for compatibility, so it isn't the model for a new theme.
|
|
12
|
+
|
|
11
13
|
|
|
12
14
|
## Use it
|
|
13
15
|
|
|
@@ -21,7 +23,7 @@ import { ThemeProvider } from '@mitcsutt/kiln-ui'
|
|
|
21
23
|
</ThemeProvider>
|
|
22
24
|
```
|
|
23
25
|
|
|
24
|
-
Fiesta's
|
|
26
|
+
Fiesta's faces (Big Shoulders, Bricolage Grotesque and Martian Mono for code) are declared in its own stylesheet, so they cost nothing unless you import it. It's light-first (the daytime show); dark mode is the floodlit night show.
|
|
25
27
|
|
|
26
28
|
## The idea, applied
|
|
27
29
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!-- Generated from the Kiln docs by apps/docs/src/skills. Edit the docs pages, then run `pnpm generate:skills`. -->
|
|
2
|
+
|
|
3
|
+
# Flightdeck
|
|
4
|
+
|
|
5
|
+
> A glass-cockpit flight display. Cyan for what you set, a reverse-video box for what you select, and green, amber and red for status, set in B612. Dark-first.
|
|
6
|
+
|
|
7
|
+
Source: https://kiln.mitchellsutton.com/docs/ui/themes/flightdeck
|
|
8
|
+
|
|
9
|
+
_A glass-cockpit flight display._ Flightdeck follows the colour convention of electronic flight instruments, where each colour has one fixed meaning, and sets everything in the typefaces designed for Airbus cockpit displays.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Use it
|
|
13
|
+
|
|
14
|
+
Flightdeck is a preset, so import its stylesheet. It's dark-first, so pair it with `defaultMode="dark"`, and give `themeScript` the same:
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import '@mitcsutt/kiln-ui/styles.css'
|
|
18
|
+
import '@mitcsutt/kiln-ui/themes/flightdeck.css'
|
|
19
|
+
import { ThemeProvider, themeScript } from '@mitcsutt/kiln-ui'
|
|
20
|
+
|
|
21
|
+
;<html lang="en">
|
|
22
|
+
<head>
|
|
23
|
+
<script dangerouslySetInnerHTML={{ __html: themeScript('flightdeck', 'dark') }} />
|
|
24
|
+
</head>
|
|
25
|
+
<body>
|
|
26
|
+
<ThemeProvider theme="flightdeck" defaultMode="dark">
|
|
27
|
+
…
|
|
28
|
+
</ThemeProvider>
|
|
29
|
+
</body>
|
|
30
|
+
</html>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## The idea, applied
|
|
34
|
+
|
|
35
|
+
- **Colour.** The cockpit convention, mapped onto Kiln's roles. Cyan is the accent: what the pilot sets and acts on. What you selected is a neutral reverse-video box, like the selected line of a flight-management display. Green, amber and red are the positive, caution and critical tones, and info is steel blue. Neutrals are dark blue-grey display glass, never black. Light mode is the day mode of an electronic flight bag: pale cool grey with the cyan darkened to pass contrast.
|
|
36
|
+
- **Type.** B612 for text, display and figures (its digits are already equal width), and B612 Mono for code. B612 ships static regular and bold weights and a Latin subset only, so Latin Extended text falls back to a system face. There are no uppercase transforms.
|
|
37
|
+
- **Shape.** Square instrument bezels: small radii on actions, fields and surfaces. Chips are pills, like annunciator capsules.
|
|
38
|
+
- **Depth.** Hairlines, with no shadow on static surfaces. Floating layers add a very subtle dark shadow, with no glow.
|
|
39
|
+
- **Motion.** Instruments move linearly and quickly: a gentle ease-out, a little faster than the default, and no bounce.
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
# Ledger
|
|
4
4
|
|
|
5
|
-
> An accountant's
|
|
5
|
+
> An accountant's columnar pad. A white sheet ruled in green, banknote-green actions, accounting red, and figures set condensed instead of in a monospace.
|
|
6
6
|
|
|
7
7
|
Source: https://kiln.mitchellsutton.com/docs/ui/themes/ledger
|
|
8
8
|
|
|
9
|
-
_An accountant's
|
|
9
|
+
_An accountant's columnar pad._ Quiet, dense and numeric. In Ledger the numbers are the content, so they get their own treatment: the same face set condensed, always tabular, so a column of money reads like receipt tape.
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
## Use it
|
|
@@ -25,8 +25,8 @@ Ledger is light-first. It suits screens that are mostly tables and totals: invoi
|
|
|
25
25
|
|
|
26
26
|
## The idea, applied
|
|
27
27
|
|
|
28
|
-
- **Colour.**
|
|
29
|
-
- **Type.**
|
|
30
|
-
- **Shape.**
|
|
31
|
-
- **Depth.** Hairlines, and a double rule above a table's footer (`--table-foot-rule`), as a ledger totals a column.
|
|
32
|
-
- **Motion.** Brief and flat (`--motion-scale: 0.8`).
|
|
28
|
+
- **Colour.** A white sheet, with the green carried by the rules rather than the paper. Banknote green for actions, accounting red for negatives and a flat highlighter yellow for the highlight. Dark mode is a blue-green carbon-copy night with dim green rules, not a green-screen terminal.
|
|
29
|
+
- **Type.** Archivo throughout. Figures use its width axis to set condensed (`--numeric-stretch`) with tabular numerals, so they get receipt-tape narrowness without a monospace. Atkinson Hyperlegible Mono is for code only. A 15px base on a 1.2 ratio.
|
|
30
|
+
- **Shape.** Tight radii on actions, fields and surfaces, squarer chips, and rounded-square avatars like ledger stamps. A compact density of 0.86, so every space step and control is smaller.
|
|
31
|
+
- **Depth.** Hairlines in the ledger green, with flat surfaces, and a double rule above a table's footer (`--table-foot-rule`), as a ledger totals a column.
|
|
32
|
+
- **Motion.** Brief and flat, with no bounce (`--motion-scale: 0.8`).
|
|
@@ -8,6 +8,8 @@ Source: https://kiln.mitchellsutton.com/docs/ui/themes/monograph
|
|
|
8
8
|
|
|
9
9
|
_A scholarly monograph read under a desk lamp at night._ Modern nostalgia: blue slate rather than black, a single ember accent that behaves like phosphor, and a serif display set big and tight over a newsroom grotesk.
|
|
10
10
|
|
|
11
|
+
Monograph predates Kiln's [second-order design rules](https://kiln.mitchellsutton.com/docs/ui/foundations/design-rules#second-order-tells) and ships unchanged for compatibility, so it isn't the model for a new theme.
|
|
12
|
+
|
|
11
13
|
|
|
12
14
|
## Use it
|
|
13
15
|
|
|
@@ -30,6 +32,8 @@ import { ThemeProvider, themeScript } from '@mitcsutt/kiln-ui'
|
|
|
30
32
|
</html>
|
|
31
33
|
```
|
|
32
34
|
|
|
35
|
+
Its faces (Newsreader, Schibsted Grotesk and Martian Mono) are declared in its own stylesheet, so they cost nothing unless you import it.
|
|
36
|
+
|
|
33
37
|
## The idea, applied
|
|
34
38
|
|
|
35
39
|
- **Colour.** Blue-slate neutrals (hue 255, never black). One ember accent (`oklch(0.72 0.15 52)` in dark, `oklch(0.565 0.158 44)` in light) that marks what's live and current, and never decorates. A cool slate highlight.
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
# Paper
|
|
4
4
|
|
|
5
|
-
> The neutral default.
|
|
5
|
+
> The neutral default. An office that prints for everyone, with white sheets on grey stock, blue-black ink as the accent and Golos Text for type.
|
|
6
6
|
|
|
7
7
|
Source: https://kiln.mitchellsutton.com/docs/ui/themes/paper
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
_An office that prints for everyone._ Paper is the theme you get when you set none. It's in the base stylesheet, and it's built to sit under any brand without arguing with it: white sheets on grey recycled stock, blue-black ink as the accent, and a typeface drawn for public services, so that everyone can read it.
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
## Use it
|
|
@@ -24,12 +24,12 @@ Paper is also declared on the document root at zero specificity, so a preset or
|
|
|
24
24
|
|
|
25
25
|
## The idea, applied
|
|
26
26
|
|
|
27
|
-
- **Colour.**
|
|
28
|
-
- **Type.**
|
|
29
|
-
- **Shape.** Square-shouldered
|
|
30
|
-
- **Depth.**
|
|
27
|
+
- **Colour.** Cool grey stock for the canvas and near-white sheets for surfaces, so a surface reads against the page by fill alone. The primary action, the current item and live state are solid blue-black ink, and links are ink told apart by their underline. The one other hue is the proofreader's non-photo blue, kept for "you", the selected row and text selection. Tones are the only saturated colour on the page.
|
|
28
|
+
- **Type.** Golos Text for everything: text, headings, display, prose and figures. Atkinson Hyperlegible Mono for code. Paratype drew Golos for a national public-services website, so it has a plain zero, true tabular figures and distinct I, l and 1, and that is why it is here. The bundle has no italic file, so italics are synthesised. There is no serif. A 16px base on a 1.25 ratio.
|
|
29
|
+
- **Shape.** Square-shouldered actions and fields, slightly rounder surfaces, and pill chips as the one deliberate contrast. Round avatars.
|
|
30
|
+
- **Depth.** A fill change rather than a border: a sheet on stock needs no edge. Soft blue-black shadows for floating layers.
|
|
31
31
|
- **Motion.** A quart ease-out, brisk, with no bounce.
|
|
32
32
|
|
|
33
|
-
## All
|
|
33
|
+
## All six themes
|
|
34
34
|
|
|
35
35
|
The same screen in each built-in theme, in the page's current mode:
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<!-- Generated from the Kiln docs by apps/docs/src/skills. Edit the docs pages, then run `pnpm generate:skills`. -->
|
|
2
|
+
|
|
3
|
+
# Riso
|
|
4
|
+
|
|
5
|
+
> A two-drum risograph zine. Fluorescent pink and blue on white stock, screen tints instead of borders, and Shantell Sans.
|
|
6
|
+
|
|
7
|
+
Source: https://kiln.mitchellsutton.com/docs/ui/themes/riso
|
|
8
|
+
|
|
9
|
+
_A two-drum risograph zine._ A riso print can't do gradients or soft shadows. It does flat spot ink, screen tints and the occasional misregistration, so that is all Riso uses: two inks on bright white stock, set in a typeface drawn from handwriting.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Use it
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import '@mitcsutt/kiln-ui/styles.css'
|
|
16
|
+
import '@mitcsutt/kiln-ui/themes/riso.css'
|
|
17
|
+
import { ThemeProvider } from '@mitcsutt/kiln-ui'
|
|
18
|
+
|
|
19
|
+
;<ThemeProvider theme="riso" defaultMode="light">
|
|
20
|
+
…
|
|
21
|
+
</ThemeProvider>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Riso's face is declared in its own stylesheet, so it costs nothing unless you import it. It's light-first, and dark mode is the deep-blue-stock edition.
|
|
25
|
+
|
|
26
|
+
## The idea, applied
|
|
27
|
+
|
|
28
|
+
- **Colour.** Two drums: fluorescent pink is the accent and blue is the text colour, on bright white stock. Surfaces are screen tints (a percentage of an ink) rather than borders. The highlight is an overprint: a pink tint under blue ink. Night mode is the same two inks printed on deep blue stock, not black.
|
|
29
|
+
- **Type.** Shantell Sans for every role except code, drawn from the artist Shantell Martin's own handwriting. It has no tabular figures, so numerals are not column-aligned. Atkinson Hyperlegible Mono is for code. A 1.25 ratio.
|
|
30
|
+
- **Shape.** Hand-cut and mixed: generous radii on actions and surfaces, smaller radii on fields, and pill chips.
|
|
31
|
+
- **Depth.** A fill change, with no shadow on static surfaces. The one misregistered moment is a hard pink offset on floating layers, as if the second drum printed slightly off.
|
|
32
|
+
- **Motion.** A mild spring: things land with a small overshoot.
|