@tristan2828/ui-foundation 4.157.0 → 5.0.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.
@@ -3,51 +3,51 @@
3
3
  <!-- index: written by `npm run docs:index` in the package from the headings below; never edit it by hand -->
4
4
  ## Index
5
5
 
6
- - [Palettes](#palettes) · lines 60–143
7
- - [Glow](#glow) · lines 145–164
8
- - [Semantic tones](#semantic-tones) · lines 166–194
9
- - [The three badge styles](#the-three-badge-styles) · lines 196–213
10
- - [Status marks](#status-marks) · lines 215–258
11
- - [Mapping an enum to tones](#mapping-an-enum-to-tones) · lines 260–289
12
- - [Glyphs and icons: 3:1](#glyphs-and-icons-31) · lines 291–302
13
- - [Logos and brand marks](#logos-and-brand-marks) · lines 304–344
14
- - [Emoji](#emoji) · lines 346–386
15
- - [Categorical colour](#categorical-colour) · lines 388–453
16
- - [Heat scale](#heat-scale) · lines 455–507
17
- - [Depth ramps](#depth-ramps) · lines 509–576
18
- - [A stored colour](#a-stored-colour) · lines 578–625
19
- - [Shapes and sizes](#shapes-and-sizes) · lines 627–648
20
- - [Typography](#typography) · lines 650–820
21
- - [Words on screen: Title Case and sentence case](#words-on-screen-title-case-and-sentence-case) · lines 684–716
22
- - [Written text (notes)](#written-text-notes) · lines 718–820
23
- - [Density](#density) · lines 822–951
24
- - [Rows on this device](#rows-on-this-device) · lines 895–923
25
- - [Page width (a record on a wide screen)](#page-width-a-record-on-a-wide-screen) · lines 925–951
26
- - [Widget cards (hub pages)](#widget-cards-hub-pages) · lines 953–1070
27
- - [Module cards (a hub's places)](#module-cards-a-hubs-places) · lines 1072–1144
28
- - [Notices](#notices) · lines 1146–1173
29
- - [A value over time](#a-value-over-time) · lines 1175–1305
30
- - [Several values over time](#several-values-over-time) · lines 1224–1262
31
- - [Parts of a whole over time](#parts-of-a-whole-over-time) · lines 1264–1305
32
- - [A list as a board](#a-list-as-a-board) · lines 1307–1417
33
- - [Order, groups and the header](#order-groups-and-the-header) · lines 1360–1417
34
- - [A list as cards](#a-list-as-cards) · lines 1419–1466
35
- - [Images full screen](#images-full-screen) · lines 1468–1514
36
- - [Key numbers on a record](#key-numbers-on-a-record) · lines 1516–1552
37
- - [Parts of the page standards](#parts-of-the-page-standards) · lines 1554–1590
38
- - [A few equal things](#a-few-equal-things) · lines 1592–1707
39
- - [An overview page](#an-overview-page) · lines 1709–1774
40
- - [A record's header and empty values](#a-records-header-and-empty-values) · lines 1776–1839
41
- - [A record's tabs, mark and facts](#a-records-tabs-mark-and-facts) · lines 1841–1928
42
- - [Picking at random](#picking-at-random) · lines 1930–1961
43
- - [Filling in what's missing](#filling-in-whats-missing) · lines 1963–2030
44
- - [Values edited in place: the presets' looks](#values-edited-in-place-the-presets-looks) · lines 2032–2051
45
- - [A quick add line](#a-quick-add-line) · lines 2053–2081
46
- - [A date field's quick picks](#a-date-fields-quick-picks) · lines 2083–2107
47
- - [A few choices, then the month](#a-few-choices-then-the-month) · lines 2109–2135
48
- - [A month calendar](#a-month-calendar) · lines 2137–2169
49
- - [A settings page](#a-settings-page) · lines 2171–2228
50
- - [The sidebar and the phone's bar](#the-sidebar-and-the-phones-bar) · lines 2230–2289
6
+ - [Palettes](#palettes) · lines 60–150
7
+ - [Glow](#glow) · lines 152–171
8
+ - [Semantic tones](#semantic-tones) · lines 173–201
9
+ - [The three badge styles](#the-three-badge-styles) · lines 203–220
10
+ - [Status marks](#status-marks) · lines 222–265
11
+ - [Mapping an enum to tones](#mapping-an-enum-to-tones) · lines 267–296
12
+ - [Glyphs and icons: 3:1](#glyphs-and-icons-31) · lines 298–309
13
+ - [Logos and brand marks](#logos-and-brand-marks) · lines 311–351
14
+ - [Emoji](#emoji) · lines 353–393
15
+ - [Categorical colour](#categorical-colour) · lines 395–460
16
+ - [Heat scale](#heat-scale) · lines 462–514
17
+ - [Depth ramps](#depth-ramps) · lines 516–583
18
+ - [A stored colour](#a-stored-colour) · lines 585–632
19
+ - [Shapes and sizes](#shapes-and-sizes) · lines 634–655
20
+ - [Typography](#typography) · lines 657–827
21
+ - [Words on screen: Title Case and sentence case](#words-on-screen-title-case-and-sentence-case) · lines 691–723
22
+ - [Written text (notes)](#written-text-notes) · lines 725–827
23
+ - [Density](#density) · lines 829–958
24
+ - [Rows on this device](#rows-on-this-device) · lines 902–930
25
+ - [Page width (a record on a wide screen)](#page-width-a-record-on-a-wide-screen) · lines 932–958
26
+ - [Widget cards (hub pages)](#widget-cards-hub-pages) · lines 960–1077
27
+ - [Module cards (a hub's places)](#module-cards-a-hubs-places) · lines 1079–1151
28
+ - [Notices](#notices) · lines 1153–1180
29
+ - [A value over time](#a-value-over-time) · lines 1182–1312
30
+ - [Several values over time](#several-values-over-time) · lines 1231–1269
31
+ - [Parts of a whole over time](#parts-of-a-whole-over-time) · lines 1271–1312
32
+ - [A list as a board](#a-list-as-a-board) · lines 1314–1424
33
+ - [Order, groups and the header](#order-groups-and-the-header) · lines 1367–1424
34
+ - [A list as cards](#a-list-as-cards) · lines 1426–1473
35
+ - [Images full screen](#images-full-screen) · lines 1475–1521
36
+ - [Key numbers on a record](#key-numbers-on-a-record) · lines 1523–1559
37
+ - [Parts of the page standards](#parts-of-the-page-standards) · lines 1561–1597
38
+ - [A few equal things](#a-few-equal-things) · lines 1599–1714
39
+ - [An overview page](#an-overview-page) · lines 1716–1781
40
+ - [A record's header and empty values](#a-records-header-and-empty-values) · lines 1783–1846
41
+ - [A record's tabs, mark and facts](#a-records-tabs-mark-and-facts) · lines 1848–1935
42
+ - [Picking at random](#picking-at-random) · lines 1937–1968
43
+ - [Filling in what's missing](#filling-in-whats-missing) · lines 1970–2037
44
+ - [Values edited in place: the presets' looks](#values-edited-in-place-the-presets-looks) · lines 2039–2058
45
+ - [A quick add line](#a-quick-add-line) · lines 2060–2088
46
+ - [A date field's quick picks](#a-date-fields-quick-picks) · lines 2090–2114
47
+ - [A few choices, then the month](#a-few-choices-then-the-month) · lines 2116–2142
48
+ - [A month calendar](#a-month-calendar) · lines 2144–2176
49
+ - [A settings page](#a-settings-page) · lines 2178–2235
50
+ - [The sidebar and the phone's bar](#the-sidebar-and-the-phones-bar) · lines 2237–2296
51
51
 
52
52
  <!-- /index -->
53
53
 
@@ -60,14 +60,20 @@ composites don't grow that way; they are built against a real app's screen.
60
60
  ## Palettes
61
61
 
62
62
  A palette is an app's own look: its surfaces, text, accent and a
63
- second colour. Four dark ones serve every app:
63
+ second colour. Four dark ones serve every app. They are all graphite:
64
+ the same neutral grey surfaces, text and borders, each with its own main
65
+ colour (the accent, its light and deep shades, the text on it, and a
66
+ second colour):
64
67
 
65
68
  | Name | `palette` | Accent | Second colour |
66
69
  |---|---|---|---|
67
- | Indigo and Cyan | `indigo-cyan` | indigo, the only accent that passes 4.5:1 on cards | cyan |
68
- | Indigo and Rose | `indigo-rose` | indigo-violet | rose |
69
- | Graphite and Periwinkle | `graphite-periwinkle` | periwinkle on neutral grey | lilac |
70
- | Violet | `violet` | violet | magenta |
70
+ | Graphite and Periwinkle | `graphite-periwinkle` | periwinkle | lilac |
71
+ | Graphite and Amber | `graphite-amber` | amber | orange |
72
+ | Graphite and Sky | `graphite-sky` | sky blue | periwinkle blue |
73
+ | Graphite and Green | `graphite-green` | green | olive |
74
+
75
+ Amber, Sky and Green have Periwinkle's lightness and strength, at their
76
+ own hue, so each reads as loud as the others.
71
77
 
72
78
  And one light one, which an app opts into by name (`LIGHT_PALETTES`):
73
79
 
@@ -75,7 +81,7 @@ And one light one, which an app opts into by name (`LIGHT_PALETTES`):
75
81
  |---|---|---|---|
76
82
  | Palm LCD | `palm-lcd` | a Palm OS LCD's green, flat (cards are the same green) | dark ink; ink is also the primary fill and the field border |
77
83
 
78
- **How an app picks one.** `<FoundationProviders palette="indigo-cyan">`
84
+ **How an app picks one.** `<FoundationProviders palette="graphite-periwinkle">`
79
85
  names the app's default. Add `palettePicker` and the app shell's header
80
86
  offers the four dark ones (with swatches), or a page does, as tiles
81
87
  (`PaletteSetting`, "A settings page"); the one picked is remembered
@@ -113,28 +119,29 @@ uses no raw colours:
113
119
  in light ([Depth ramps](#depth-ramps)). Every heat and depth fill
114
120
  takes white text.
115
121
 
116
- **Where it lives.** `styles/theme.css`: each palette's colours as
117
- primitives (`--palette-<name>-*`, ratios beside them), and one block per
118
- palette that sets only what differs from its theme:
119
- `.dark[data-palette="<name>"]` for the four, and `[data-palette="palm-lcd"]`,
120
- on top of `:root`, for Palm LCD. `data-palette` goes on `<html>`, so popups
122
+ **Where it lives.** `styles/theme.css`: the shared greys as primitives
123
+ (`--palette-graphite-*`), each palette's main colour as five more
124
+ (`--palette-<name>-*`), with ratios beside them. One block,
125
+ `.dark[data-palette^="graphite-"]`, maps them onto the tokens; each
126
+ palette's own block, `.dark[data-palette="<name>"]`, only names its main
127
+ colour. `[data-palette="palm-lcd"]`, on top of `:root`, is Palm LCD's. `data-palette` goes on `<html>`, so popups
121
128
  portaled to `<body>` wear it too. An installed app's colours follow it with
122
129
  `pwa({ palette })`. For Palm LCD that is the ink and the green.
123
130
 
124
131
  **The accent is never small text.** It fails 4.5:1 as small text on
125
- Indigo and Rose and on Violet, and on every palette's cards but Indigo
126
- and Cyan: it is the ring, the primary fill and the active item's tint.
127
- Links are accent light (`--link`, 8.5:1 or more; the `link` Button
132
+ every palette's cards (4.3 to 4.9): it is the ring, the primary fill and
133
+ the active item's tint.
134
+ Links are accent light (`--link`, 9.1:1 or more on cards; the `link` Button
128
135
  variant is `text-link`), and so is the theme colour as text
129
136
  (`--primary-text`: the open tab's name, a picked choice's word). The
130
137
  status colours as text are `--success-text`, `--warning-text` and
131
138
  `--destructive-text` (soft badges, icons, coloured words); solid fills
132
139
  keep the deeper shades with white text. Field borders (`--input`)
133
- measure 2.5 to 2.9 against the page, under 3:1; axe doesn't check
140
+ measure 2.9 against the page, under 3:1; axe doesn't check
134
141
  borders.
135
142
 
136
143
  **An app's own axe specs** check its palettes instead of light and dark:
137
- `defineA11ySuite({ …, palettes: ['indigo-cyan'] })` (and
144
+ `defineA11ySuite({ …, palettes: ['graphite-periwinkle'] })` (and
138
145
  `defineDataEnvironmentBannerSuite`'s `palettes`) saves each as the
139
146
  device's choice before the page loads and checks it in the theme it
140
147
  forces: dark, or light for `palettes: ['palm-lcd']`. Pass the app's
@@ -901,7 +908,7 @@ toggle in an app without a palette). `RowsSetting` offers the same choice
901
908
  on a page ("A settings page").
902
909
 
903
910
  ```tsx
904
- <FoundationProviders palette="indigo-cyan" palettePicker rowsPicker …>
911
+ <FoundationProviders palette="graphite-periwinkle" palettePicker rowsPicker …>
905
912
  ```
906
913
 
907
914
  | Rows | Table cell padding (vertical) | Header height |
@@ -17,7 +17,7 @@ import { useShellDocumentTitle } from '../../hooks/use-document-title.js';
17
17
  import { usePalette } from '../../hooks/use-palette.js';
18
18
  import { useRows } from '../../hooks/use-rows.js';
19
19
  import { clearRecentRecords } from '../../lib/search-palette.js';
20
- import { isPaletteName, PALETTE_LABELS, PALETTES } from '../../lib/palettes.js';
20
+ import { isPaletteName, PALETTE_LABELS, paletteColour, PALETTES } from '../../lib/palettes.js';
21
21
  import { isRowsName, ROWS, ROWS_LABELS } from '../../lib/rows.js';
22
22
  import { cn } from 'cn';
23
23
  import { Button, buttonVariants } from '../ui/button.js';
@@ -63,7 +63,7 @@ function LookControl({ menu }) {
63
63
  // colour on it, read from the palette primitives, so the menu shows all
64
64
  // four whichever is on screen.
65
65
  function PaletteSwatch({ name }) {
66
- const colour = (part) => `var(--palette-${name}-${part})`;
66
+ const colour = (part) => paletteColour(name, part);
67
67
  return (_jsxs("span", { "aria-hidden": true, className: "flex h-4 w-7 shrink-0 items-center justify-center gap-0.5 rounded-sm border border-border", style: { background: colour('background') }, children: [_jsx("span", { className: "size-2 rounded-full", style: { background: colour('accent') } }), _jsx("span", { className: "size-2 rounded-full", style: { background: colour('second') } })] }));
68
68
  }
69
69
  // `palette` is null when only the rows are offered: the trigger is then
@@ -3,7 +3,7 @@ import { cn } from 'cn';
3
3
  import { RadioGroup, RadioGroupItem } from '../ui/radio-group.js';
4
4
  import { usePalette } from '../../hooks/use-palette.js';
5
5
  import { useRows } from '../../hooks/use-rows.js';
6
- import { isPaletteName, PALETTE_LABELS, PALETTES } from '../../lib/palettes.js';
6
+ import { isPaletteName, PALETTE_LABELS, paletteColour, PALETTES } from '../../lib/palettes.js';
7
7
  import { ROWS, ROWS_LABELS } from '../../lib/rows.js';
8
8
  import { ChoiceButtons } from './choice-buttons.js';
9
9
  import { SettingsRow } from './settings-page.js';
@@ -16,7 +16,7 @@ const TILE = cn('relative cursor-pointer overflow-hidden rounded-lg border borde
16
16
  // title, a line and a button. Read from the palette primitives, so every
17
17
  // tile shows its own whichever palette is on screen.
18
18
  function PalettePreview({ name }) {
19
- const colour = (part) => `var(--palette-${name}-${part})`;
19
+ const colour = (part) => paletteColour(name, part);
20
20
  const bar = (part, className) => (_jsx("span", { className: cn('h-1.25 rounded-full', className), style: { background: colour(part) } }));
21
21
  return (_jsxs("span", { "aria-hidden": true, className: "grid h-16 grid-cols-[--spacing(8.5)_minmax(0,1fr)] border-b border-border", style: { background: colour('background') }, children: [_jsxs("span", { className: "flex flex-col gap-1.25 px-1.5 py-2", style: { background: colour('panel') }, children: [bar('accent'), bar('dim'), bar('dim')] }), _jsxs("span", { className: "flex flex-col gap-1.5 p-2.25", children: [bar('dim', 'w-[70%]'), bar('second', 'w-[40%]'), bar('accent', 'h-2.5 w-[28%]')] })] }));
22
22
  }
@@ -1,10 +1,16 @@
1
1
  import { type DeviceChoiceStore, type StorageLike } from './device-choice.js';
2
- export declare const PALETTES: readonly ["indigo-cyan", "indigo-rose", "graphite-periwinkle", "violet"];
2
+ export declare const PALETTES: readonly ["graphite-periwinkle", "graphite-amber", "graphite-sky", "graphite-green"];
3
3
  export type PaletteName = (typeof PALETTES)[number];
4
- /** Each palette's name as a person reads it, in the guide's ranked order. */
4
+ /** Each palette's name as a person reads it, in the picker's order. */
5
5
  export declare const PALETTE_LABELS: Record<PaletteName, string>;
6
6
  /** Where a device's chosen palette is kept. */
7
7
  export declare const PALETTE_STORAGE_KEY = "ui-foundation:palette";
8
+ /** The parts of a dark palette every one shares (its greys) and the parts that are its main colour. */
9
+ declare const GREY_PARTS: readonly ["background", "panel", "raised", "border", "strong-border", "text", "dim"];
10
+ type MainPart = 'accent' | 'accent-light' | 'accent-deep' | 'on-accent' | 'second';
11
+ export type PalettePart = (typeof GREY_PARTS)[number] | MainPart;
12
+ /** The theme.css primitive holding one part of a dark palette, for a swatch that shows it whichever palette is on screen. */
13
+ export declare function paletteColour(name: PaletteName, part: PalettePart): string;
8
14
  export declare function isPaletteName(value: unknown): value is PaletteName;
9
15
  /** The light palettes, which an app opts into by name: never in the picker (design-language.md "Palettes"). */
10
16
  export declare const LIGHT_PALETTES: readonly ["palm-lcd"];
@@ -21,3 +27,4 @@ export type PaletteStore = DeviceChoiceStore<PaletteName>;
21
27
  export declare function createPaletteStore(getStorage: () => StorageLike | undefined): PaletteStore;
22
28
  export declare const browserPaletteStore: PaletteStore;
23
29
  export declare const subscribeToBrowserPaletteStore: (listener: () => void) => () => void;
30
+ export {};
@@ -1,10 +1,10 @@
1
- // The four palettes (design-language.md "Palettes"): an app's own dark
2
- // look, one of those the shared style guide chose. FoundationProviders'
1
+ // The four dark palettes (design-language.md "Palettes"): an app's own
2
+ // look, graphite greys with one main colour each. FoundationProviders'
3
3
  // `palette` names the app's default; with `palettePicker` the app shell's
4
4
  // look menu or a settings page (PaletteSetting) offers all four and the
5
5
  // choice is remembered on this device (localStorage, this store). A new device starts on the default. The
6
6
  // palette rides on <html> as data-palette, so popups portaled to <body>
7
- // wear it too, and styles/theme.css's `.dark[data-palette]` blocks do the
7
+ // wear it too, and styles/theme.css's `.dark[data-palette^="graphite-"]` blocks do the
8
8
  // rest (components/app/palette-provider.tsx, hooks/use-palette.ts).
9
9
  //
10
10
  // The light palettes (LIGHT_PALETTES, so far one: Palm LCD) are opt-in: an
@@ -12,16 +12,22 @@
12
12
  // it is never in the picker, and it has no glow. Its block is
13
13
  // `[data-palette="<name>"]` on top of :root.
14
14
  import { browserStorage, createDeviceChoiceStore, otherTabsSubscriber } from './device-choice.js';
15
- export const PALETTES = ['indigo-cyan', 'indigo-rose', 'graphite-periwinkle', 'violet'];
16
- /** Each palette's name as a person reads it, in the guide's ranked order. */
15
+ export const PALETTES = ['graphite-periwinkle', 'graphite-amber', 'graphite-sky', 'graphite-green'];
16
+ /** Each palette's name as a person reads it, in the picker's order. */
17
17
  export const PALETTE_LABELS = {
18
- 'indigo-cyan': 'Indigo and Cyan',
19
- 'indigo-rose': 'Indigo and Rose',
20
18
  'graphite-periwinkle': 'Graphite and Periwinkle',
21
- violet: 'Violet',
19
+ 'graphite-amber': 'Graphite and Amber',
20
+ 'graphite-sky': 'Graphite and Sky',
21
+ 'graphite-green': 'Graphite and Green',
22
22
  };
23
23
  /** Where a device's chosen palette is kept. */
24
24
  export const PALETTE_STORAGE_KEY = 'ui-foundation:palette';
25
+ /** The parts of a dark palette every one shares (its greys) and the parts that are its main colour. */
26
+ const GREY_PARTS = ['background', 'panel', 'raised', 'border', 'strong-border', 'text', 'dim'];
27
+ /** The theme.css primitive holding one part of a dark palette, for a swatch that shows it whichever palette is on screen. */
28
+ export function paletteColour(name, part) {
29
+ return GREY_PARTS.includes(part) ? `var(--palette-graphite-${part})` : `var(--palette-${name}-${part})`;
30
+ }
25
31
  export function isPaletteName(value) {
26
32
  return typeof value === 'string' && PALETTES.includes(value);
27
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tristan2828/ui-foundation",
3
- "version": "4.157.0",
3
+ "version": "5.0.0",
4
4
  "description": "Shared UI foundation for contract-first, database-backed React apps: shadcn primitives, DataTable/EntityForm composites, auth, the gateway error seam, design tokens, lint rules and the AI playbook.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/styles/theme.css CHANGED
@@ -304,77 +304,61 @@
304
304
 
305
305
  /*
306
306
  * Palette primitives (design-language.md "Palettes"). A palette is an
307
- * app's own look: these four dark ones were chosen for the shared style
308
- * guide, and an app names one (FoundationProviders' `palette`). Each is
309
- * the guide's colours as written, with one change: Violet's text on its
310
- * accent was #130925 (4.496:1, just under 4.5) and is #110823 (4.54:1).
311
- * The semantic blocks under `.dark[data-palette]`, at the end of this
312
- * file, map them onto the tokens components use. Ratios are against the
313
- * palette's own background (bg), card and raised surfaces (WCAG 2.x,
314
- * sRGB), listed 1 Indigo and Cyan / 2 Indigo and Rose / 3 Graphite and
315
- * Periwinkle / 4 Violet:
307
+ * app's own look. The four dark ones are graphite: they share one set
308
+ * of neutral greys (--palette-graphite-*) and each has its own main
309
+ * colour, five values (--palette-graphite-<hue>-*). The semantic block
310
+ * under `.dark[data-palette^="graphite-"]`, at the end of this file,
311
+ * maps them onto the tokens components use. Ratios are against the
312
+ * greys' background (bg), card and raised surfaces (WCAG 2.x, sRGB).
316
313
  *
317
- * text on bg 15.0 / 15.3 / 15.0 / 15.0, on card 13.4 / 13.9 / 13.4 / 13.4
318
- * dim on bg 7.47 / 7.42 / 7.54 / 7.47, on raised 5.87 / 6.06 / 5.79 / 5.87
319
- * accent on bg 5.25 / 4.33 / 4.87 / 4.24, on card 4.68 / 3.94 / 4.32 / 3.78:
320
- * never small text (2 and 4 fail); the ring and fills only
321
- * on-accent on accent 5.49 / 4.51 / 5.28 / 4.54
322
- * accent-light on bg 10.3 / 9.65 / 10.4 / 8.53, on card 9.16 / 8.77 / 9.19 / 7.61: links
323
- * strong-border on bg 2.79 / 2.53 / 2.89 / 2.79: under 3:1, the guide's
324
- * lightest grey, kept as designed (axe doesn't check borders)
325
- * second on card 9.47 / 5.85 / 5.08 / 4.79
314
+ * The greys, every graphite palette:
315
+ * text on bg 15.0, on card 13.4
316
+ * dim on bg 7.54, on raised 5.79
317
+ * strong-border on bg 2.89: under 3:1, kept as designed (axe does
318
+ * not check borders)
319
+ *
320
+ * Each main colour, listed Periwinkle / Amber / Sky / Green:
321
+ * accent on bg 4.87 / 4.99 / 5.25 / 5.54, on card 4.32 / 4.43 /
322
+ * 4.66 / 4.92: never small text; the ring and fills only
323
+ * on-accent on accent 5.28 / 5.43 / 5.68 / 5.97
324
+ * accent-light on bg 10.4 / 10.4 / 10.6 / 10.9, on card 9.19 / 9.23 /
325
+ * 9.44 / 9.65, on raised 7.95 at the least: links
326
+ * accent-deep a chart's third series, never text
327
+ * second on card 5.08 / 5.07 / 5.24 / 5.50
328
+ * Amber, Sky and Green are Periwinkle's lightness and strength in
329
+ * OKLCH, at their own hue.
326
330
  */
327
- --palette-indigo-cyan-background: #13161b;
328
- --palette-indigo-cyan-panel: #1c2129;
329
- --palette-indigo-cyan-raised: #252b35;
330
- --palette-indigo-cyan-border: #38414d;
331
- --palette-indigo-cyan-strong-border: #535f6f;
332
- --palette-indigo-cyan-text: #e7eaee;
333
- --palette-indigo-cyan-dim: #a0a7b1;
334
- --palette-indigo-cyan-accent: #6682f5;
335
- --palette-indigo-cyan-accent-light: #b2c1fa;
336
- --palette-indigo-cyan-accent-deep: #224cf1;
337
- --palette-indigo-cyan-on-accent: #090f25;
338
- --palette-indigo-cyan-second: #6dd4ee;
339
-
340
- --palette-indigo-rose-background: #101219;
341
- --palette-indigo-rose-panel: #181c28;
342
- --palette-indigo-rose-raised: #202534;
343
- --palette-indigo-rose-border: #32394e;
344
- --palette-indigo-rose-strong-border: #4c5570;
345
- --palette-indigo-rose-text: #e6e8ef;
346
- --palette-indigo-rose-dim: #9da3b4;
347
- --palette-indigo-rose-accent: #6868f3;
348
- --palette-indigo-rose-accent-light: #b4b4f9;
349
- --palette-indigo-rose-accent-deep: #2626ed;
350
- --palette-indigo-rose-on-accent: #090925;
351
- --palette-indigo-rose-second: #ec6f8e;
331
+ --palette-graphite-background: #171717;
332
+ --palette-graphite-panel: #222222;
333
+ --palette-graphite-raised: #2d2d2d;
334
+ --palette-graphite-border: #424242;
335
+ --palette-graphite-strong-border: #616161;
336
+ --palette-graphite-text: #ebebeb;
337
+ --palette-graphite-dim: #a8a8a8;
352
338
 
353
- --palette-graphite-periwinkle-background: #171717;
354
- --palette-graphite-periwinkle-panel: #222222;
355
- --palette-graphite-periwinkle-raised: #2d2d2d;
356
- --palette-graphite-periwinkle-border: #424242;
357
- --palette-graphite-periwinkle-strong-border: #616161;
358
- --palette-graphite-periwinkle-text: #ebebeb;
359
- --palette-graphite-periwinkle-dim: #a8a8a8;
360
339
  --palette-graphite-periwinkle-accent: #7f75f0;
361
340
  --palette-graphite-periwinkle-accent-light: #c3bff8;
362
341
  --palette-graphite-periwinkle-accent-deep: #4435e9;
363
342
  --palette-graphite-periwinkle-on-accent: #0b0925;
364
343
  --palette-graphite-periwinkle-second: #a97bea;
365
344
 
366
- --palette-violet-background: #13161b;
367
- --palette-violet-panel: #1c2129;
368
- --palette-violet-raised: #252b35;
369
- --palette-violet-border: #38414d;
370
- --palette-violet-strong-border: #535f6f;
371
- --palette-violet-text: #e7eaee;
372
- --palette-violet-dim: #a0a7b1;
373
- --palette-violet-accent: #905ceb;
374
- --palette-violet-accent-light: #c1a4f4;
375
- --palette-violet-accent-deep: #651ce3;
376
- --palette-violet-on-accent: #110823;
377
- --palette-violet-second: #c363e4;
345
+ --palette-graphite-amber-accent: #bd7801;
346
+ --palette-graphite-amber-accent-light: #e8be8e;
347
+ --palette-graphite-amber-accent-deep: #845200;
348
+ --palette-graphite-amber-on-accent: #160a00;
349
+ --palette-graphite-amber-second: #e86d40;
350
+
351
+ --palette-graphite-sky-accent: #0093d7;
352
+ --palette-graphite-sky-accent-light: #97cef5;
353
+ --palette-graphite-sky-accent-deep: #006697;
354
+ --palette-graphite-sky-on-accent: #000f1b;
355
+ --palette-graphite-sky-second: #7b8bfa;
356
+
357
+ --palette-graphite-green-accent: #06a54c;
358
+ --palette-graphite-green-accent-light: #a2d6ab;
359
+ --palette-graphite-green-accent-deep: #017332;
360
+ --palette-graphite-green-on-accent: #001204;
361
+ --palette-graphite-green-second: #9d9d09;
378
362
 
379
363
  /*
380
364
  * The status colours every palette shares, as TEXT shades (--*-text):
@@ -1213,202 +1197,103 @@
1213
1197
  * Palettes (design-language.md "Palettes"): an app's own dark look.
1214
1198
  * FoundationProviders' `palette` puts data-palette on <html> and forces
1215
1199
  * the dark theme (Palm LCD, the light one, is at the end of this file),
1216
- * so a block below always sits on top of .dark and sets
1217
- * only what differs from it. The solid fills (--destructive, --success,
1218
- * --warning, --info, each with white -foreground), --info-text, the
1219
- * highlight washes, the categorical slots, the heat scale and the depth
1220
- * ramps stay .dark's.
1200
+ * so the block below always sits on top of .dark and sets only what
1201
+ * differs from it. Every dark palette is graphite: one block maps the
1202
+ * shared greys and the palette's main colour, read through five
1203
+ * --palette-main-* names that each palette's own small block sets. The
1204
+ * solid fills (--destructive, --success, --warning, --info, each with
1205
+ * white -foreground), --info-text, the highlight washes, the categorical
1206
+ * slots, the heat scale and the depth ramps stay .dark's.
1221
1207
  *
1222
- * --ring is the accent (4.24 to 5.25 on the page), not the guide's
1223
- * accent deep (2.30 to 2.91, under the 3:1 a focus ring needs).
1224
- * --link is accent light: the accent fails 4.5 as small text on 2 and 4.
1208
+ * --ring is the accent (4.87 to 5.54 on the page), not accent deep
1209
+ * (2.50 to 2.99, under the 3:1 a focus ring needs).
1210
+ * --link is accent light: the accent fails 4.5 as small text on cards.
1225
1211
  * --*-text are the shared status shades; the fills are unchanged.
1226
1212
  * --sidebar-accent, the active and hovered item, is a soft accent tint
1227
- * on the panel (16%): text on it 10.8 / 11.6 / 10.9 / 11.2, dim 5.35
1228
- * at the least.
1213
+ * on the panel (16%): text on it 10.8 at the least, dim 5.41.
1229
1214
  * Derived in .dark and resolved with these values, since both blocks
1230
- * apply to <html>: --table-stripe (dim on it 6.86 at the
1231
- * least), --table-highlight (dim 6.30), --heading-band (text 7.79).
1232
- * --rule is the strong border (2.53 to 2.89; .dark's was 2.54).
1215
+ * apply to <html>: --table-stripe, --table-highlight, --heading-band.
1216
+ * --rule is the strong border (2.89; .dark's was 2.54).
1233
1217
  *
1234
1218
  * Printed notes still print light: index.css's print override is more
1235
- * specific than these blocks (tests: entity-view-print.spec.ts).
1219
+ * specific than this block (tests: entity-view-print.spec.ts).
1236
1220
  */
1237
1221
 
1238
- .dark[data-palette="indigo-cyan"] {
1239
- --background: var(--palette-indigo-cyan-background);
1240
- --foreground: var(--palette-indigo-cyan-text);
1241
- --card: var(--palette-indigo-cyan-panel);
1242
- --card-foreground: var(--palette-indigo-cyan-text);
1243
- --popover: var(--palette-indigo-cyan-panel);
1244
- --popover-foreground: var(--palette-indigo-cyan-text);
1245
- --primary: var(--palette-indigo-cyan-accent);
1246
- --primary-foreground: var(--palette-indigo-cyan-on-accent);
1247
- --secondary: var(--palette-indigo-cyan-raised);
1248
- --secondary-foreground: var(--palette-indigo-cyan-text);
1249
- --muted: var(--palette-indigo-cyan-raised);
1250
- --muted-foreground: var(--palette-indigo-cyan-dim);
1251
- --accent: var(--palette-indigo-cyan-raised);
1252
- --accent-foreground: var(--palette-indigo-cyan-text);
1253
- --accent-second: var(--palette-indigo-cyan-second);
1222
+ .dark[data-palette^="graphite-"] {
1223
+ --background: var(--palette-graphite-background);
1224
+ --foreground: var(--palette-graphite-text);
1225
+ --card: var(--palette-graphite-panel);
1226
+ --card-foreground: var(--palette-graphite-text);
1227
+ --popover: var(--palette-graphite-panel);
1228
+ --popover-foreground: var(--palette-graphite-text);
1229
+ --primary: var(--palette-main-accent);
1230
+ --primary-foreground: var(--palette-main-on-accent);
1231
+ --secondary: var(--palette-graphite-raised);
1232
+ --secondary-foreground: var(--palette-graphite-text);
1233
+ --muted: var(--palette-graphite-raised);
1234
+ --muted-foreground: var(--palette-graphite-dim);
1235
+ --accent: var(--palette-graphite-raised);
1236
+ --accent-foreground: var(--palette-graphite-text);
1237
+ --accent-second: var(--palette-main-second);
1254
1238
  --destructive-text: var(--palette-danger);
1255
1239
  --success-text: var(--palette-success);
1256
1240
  --warning-text: var(--palette-warning);
1257
1241
  --status-done-text: var(--palette-done);
1258
1242
  --status-ended-text: var(--palette-ended);
1259
- --link: var(--palette-indigo-cyan-accent-light);
1260
- --primary-text: var(--palette-indigo-cyan-accent-light);
1261
- --heading-bar: var(--palette-indigo-cyan-accent-light);
1262
- --rule: var(--palette-indigo-cyan-strong-border);
1263
- --table-highlight-muted-foreground: var(--palette-indigo-cyan-dim);
1264
- --border: var(--palette-indigo-cyan-border);
1265
- --input: var(--palette-indigo-cyan-strong-border);
1266
- --ring: var(--palette-indigo-cyan-accent);
1267
- --chart-1: var(--palette-indigo-cyan-accent-light);
1268
- --chart-2: var(--palette-indigo-cyan-accent);
1269
- --chart-3: var(--palette-indigo-cyan-accent-deep);
1270
- --chart-4: var(--palette-indigo-cyan-second);
1271
- --chart-5: var(--palette-indigo-cyan-border);
1272
- --sidebar: var(--palette-indigo-cyan-panel);
1273
- --sidebar-foreground: var(--palette-indigo-cyan-text);
1274
- --sidebar-primary: var(--palette-indigo-cyan-accent);
1275
- --sidebar-primary-foreground: var(--palette-indigo-cyan-on-accent);
1276
- --sidebar-accent: color-mix(in srgb, var(--palette-indigo-cyan-accent) 16%, var(--palette-indigo-cyan-panel));
1277
- --sidebar-accent-foreground: var(--palette-indigo-cyan-text);
1278
- --sidebar-border: var(--palette-indigo-cyan-border);
1279
- --sidebar-ring: var(--palette-indigo-cyan-accent);
1243
+ --link: var(--palette-main-accent-light);
1244
+ --primary-text: var(--palette-main-accent-light);
1245
+ --heading-bar: var(--palette-main-accent-light);
1246
+ --rule: var(--palette-graphite-strong-border);
1247
+ --table-highlight-muted-foreground: var(--palette-graphite-dim);
1248
+ --border: var(--palette-graphite-border);
1249
+ --input: var(--palette-graphite-strong-border);
1250
+ --ring: var(--palette-main-accent);
1251
+ --chart-1: var(--palette-main-accent-light);
1252
+ --chart-2: var(--palette-main-accent);
1253
+ --chart-3: var(--palette-main-accent-deep);
1254
+ --chart-4: var(--palette-main-second);
1255
+ --chart-5: var(--palette-graphite-border);
1256
+ --sidebar: var(--palette-graphite-panel);
1257
+ --sidebar-foreground: var(--palette-graphite-text);
1258
+ --sidebar-primary: var(--palette-main-accent);
1259
+ --sidebar-primary-foreground: var(--palette-main-on-accent);
1260
+ --sidebar-accent: color-mix(in srgb, var(--palette-main-accent) 16%, var(--palette-graphite-panel));
1261
+ --sidebar-accent-foreground: var(--palette-graphite-text);
1262
+ --sidebar-border: var(--palette-graphite-border);
1263
+ --sidebar-ring: var(--palette-main-accent);
1280
1264
  }
1281
1265
 
1282
- .dark[data-palette="indigo-rose"] {
1283
- --background: var(--palette-indigo-rose-background);
1284
- --foreground: var(--palette-indigo-rose-text);
1285
- --card: var(--palette-indigo-rose-panel);
1286
- --card-foreground: var(--palette-indigo-rose-text);
1287
- --popover: var(--palette-indigo-rose-panel);
1288
- --popover-foreground: var(--palette-indigo-rose-text);
1289
- --primary: var(--palette-indigo-rose-accent);
1290
- --primary-foreground: var(--palette-indigo-rose-on-accent);
1291
- --secondary: var(--palette-indigo-rose-raised);
1292
- --secondary-foreground: var(--palette-indigo-rose-text);
1293
- --muted: var(--palette-indigo-rose-raised);
1294
- --muted-foreground: var(--palette-indigo-rose-dim);
1295
- --accent: var(--palette-indigo-rose-raised);
1296
- --accent-foreground: var(--palette-indigo-rose-text);
1297
- --accent-second: var(--palette-indigo-rose-second);
1298
- --destructive-text: var(--palette-danger);
1299
- --success-text: var(--palette-success);
1300
- --warning-text: var(--palette-warning);
1301
- --status-done-text: var(--palette-done);
1302
- --status-ended-text: var(--palette-ended);
1303
- --link: var(--palette-indigo-rose-accent-light);
1304
- --primary-text: var(--palette-indigo-rose-accent-light);
1305
- --heading-bar: var(--palette-indigo-rose-accent-light);
1306
- --rule: var(--palette-indigo-rose-strong-border);
1307
- --table-highlight-muted-foreground: var(--palette-indigo-rose-dim);
1308
- --border: var(--palette-indigo-rose-border);
1309
- --input: var(--palette-indigo-rose-strong-border);
1310
- --ring: var(--palette-indigo-rose-accent);
1311
- --chart-1: var(--palette-indigo-rose-accent-light);
1312
- --chart-2: var(--palette-indigo-rose-accent);
1313
- --chart-3: var(--palette-indigo-rose-accent-deep);
1314
- --chart-4: var(--palette-indigo-rose-second);
1315
- --chart-5: var(--palette-indigo-rose-border);
1316
- --sidebar: var(--palette-indigo-rose-panel);
1317
- --sidebar-foreground: var(--palette-indigo-rose-text);
1318
- --sidebar-primary: var(--palette-indigo-rose-accent);
1319
- --sidebar-primary-foreground: var(--palette-indigo-rose-on-accent);
1320
- --sidebar-accent: color-mix(in srgb, var(--palette-indigo-rose-accent) 16%, var(--palette-indigo-rose-panel));
1321
- --sidebar-accent-foreground: var(--palette-indigo-rose-text);
1322
- --sidebar-border: var(--palette-indigo-rose-border);
1323
- --sidebar-ring: var(--palette-indigo-rose-accent);
1266
+ /* Each graphite palette's main colour (design-language.md "Palettes"). */
1267
+ .dark[data-palette="graphite-periwinkle"] {
1268
+ --palette-main-accent: var(--palette-graphite-periwinkle-accent);
1269
+ --palette-main-accent-light: var(--palette-graphite-periwinkle-accent-light);
1270
+ --palette-main-accent-deep: var(--palette-graphite-periwinkle-accent-deep);
1271
+ --palette-main-on-accent: var(--palette-graphite-periwinkle-on-accent);
1272
+ --palette-main-second: var(--palette-graphite-periwinkle-second);
1324
1273
  }
1325
1274
 
1326
- .dark[data-palette="graphite-periwinkle"] {
1327
- --background: var(--palette-graphite-periwinkle-background);
1328
- --foreground: var(--palette-graphite-periwinkle-text);
1329
- --card: var(--palette-graphite-periwinkle-panel);
1330
- --card-foreground: var(--palette-graphite-periwinkle-text);
1331
- --popover: var(--palette-graphite-periwinkle-panel);
1332
- --popover-foreground: var(--palette-graphite-periwinkle-text);
1333
- --primary: var(--palette-graphite-periwinkle-accent);
1334
- --primary-foreground: var(--palette-graphite-periwinkle-on-accent);
1335
- --secondary: var(--palette-graphite-periwinkle-raised);
1336
- --secondary-foreground: var(--palette-graphite-periwinkle-text);
1337
- --muted: var(--palette-graphite-periwinkle-raised);
1338
- --muted-foreground: var(--palette-graphite-periwinkle-dim);
1339
- --accent: var(--palette-graphite-periwinkle-raised);
1340
- --accent-foreground: var(--palette-graphite-periwinkle-text);
1341
- --accent-second: var(--palette-graphite-periwinkle-second);
1342
- --destructive-text: var(--palette-danger);
1343
- --success-text: var(--palette-success);
1344
- --warning-text: var(--palette-warning);
1345
- --status-done-text: var(--palette-done);
1346
- --status-ended-text: var(--palette-ended);
1347
- --link: var(--palette-graphite-periwinkle-accent-light);
1348
- --primary-text: var(--palette-graphite-periwinkle-accent-light);
1349
- --heading-bar: var(--palette-graphite-periwinkle-accent-light);
1350
- --rule: var(--palette-graphite-periwinkle-strong-border);
1351
- --table-highlight-muted-foreground: var(--palette-graphite-periwinkle-dim);
1352
- --border: var(--palette-graphite-periwinkle-border);
1353
- --input: var(--palette-graphite-periwinkle-strong-border);
1354
- --ring: var(--palette-graphite-periwinkle-accent);
1355
- --chart-1: var(--palette-graphite-periwinkle-accent-light);
1356
- --chart-2: var(--palette-graphite-periwinkle-accent);
1357
- --chart-3: var(--palette-graphite-periwinkle-accent-deep);
1358
- --chart-4: var(--palette-graphite-periwinkle-second);
1359
- --chart-5: var(--palette-graphite-periwinkle-border);
1360
- --sidebar: var(--palette-graphite-periwinkle-panel);
1361
- --sidebar-foreground: var(--palette-graphite-periwinkle-text);
1362
- --sidebar-primary: var(--palette-graphite-periwinkle-accent);
1363
- --sidebar-primary-foreground: var(--palette-graphite-periwinkle-on-accent);
1364
- --sidebar-accent: color-mix(in srgb, var(--palette-graphite-periwinkle-accent) 16%, var(--palette-graphite-periwinkle-panel));
1365
- --sidebar-accent-foreground: var(--palette-graphite-periwinkle-text);
1366
- --sidebar-border: var(--palette-graphite-periwinkle-border);
1367
- --sidebar-ring: var(--palette-graphite-periwinkle-accent);
1275
+ .dark[data-palette="graphite-amber"] {
1276
+ --palette-main-accent: var(--palette-graphite-amber-accent);
1277
+ --palette-main-accent-light: var(--palette-graphite-amber-accent-light);
1278
+ --palette-main-accent-deep: var(--palette-graphite-amber-accent-deep);
1279
+ --palette-main-on-accent: var(--palette-graphite-amber-on-accent);
1280
+ --palette-main-second: var(--palette-graphite-amber-second);
1368
1281
  }
1369
1282
 
1370
- .dark[data-palette="violet"] {
1371
- --background: var(--palette-violet-background);
1372
- --foreground: var(--palette-violet-text);
1373
- --card: var(--palette-violet-panel);
1374
- --card-foreground: var(--palette-violet-text);
1375
- --popover: var(--palette-violet-panel);
1376
- --popover-foreground: var(--palette-violet-text);
1377
- --primary: var(--palette-violet-accent);
1378
- --primary-foreground: var(--palette-violet-on-accent);
1379
- --secondary: var(--palette-violet-raised);
1380
- --secondary-foreground: var(--palette-violet-text);
1381
- --muted: var(--palette-violet-raised);
1382
- --muted-foreground: var(--palette-violet-dim);
1383
- --accent: var(--palette-violet-raised);
1384
- --accent-foreground: var(--palette-violet-text);
1385
- --accent-second: var(--palette-violet-second);
1386
- --destructive-text: var(--palette-danger);
1387
- --success-text: var(--palette-success);
1388
- --warning-text: var(--palette-warning);
1389
- --status-done-text: var(--palette-done);
1390
- --status-ended-text: var(--palette-ended);
1391
- --link: var(--palette-violet-accent-light);
1392
- --primary-text: var(--palette-violet-accent-light);
1393
- --heading-bar: var(--palette-violet-accent-light);
1394
- --rule: var(--palette-violet-strong-border);
1395
- --table-highlight-muted-foreground: var(--palette-violet-dim);
1396
- --border: var(--palette-violet-border);
1397
- --input: var(--palette-violet-strong-border);
1398
- --ring: var(--palette-violet-accent);
1399
- --chart-1: var(--palette-violet-accent-light);
1400
- --chart-2: var(--palette-violet-accent);
1401
- --chart-3: var(--palette-violet-accent-deep);
1402
- --chart-4: var(--palette-violet-second);
1403
- --chart-5: var(--palette-violet-border);
1404
- --sidebar: var(--palette-violet-panel);
1405
- --sidebar-foreground: var(--palette-violet-text);
1406
- --sidebar-primary: var(--palette-violet-accent);
1407
- --sidebar-primary-foreground: var(--palette-violet-on-accent);
1408
- --sidebar-accent: color-mix(in srgb, var(--palette-violet-accent) 16%, var(--palette-violet-panel));
1409
- --sidebar-accent-foreground: var(--palette-violet-text);
1410
- --sidebar-border: var(--palette-violet-border);
1411
- --sidebar-ring: var(--palette-violet-accent);
1283
+ .dark[data-palette="graphite-sky"] {
1284
+ --palette-main-accent: var(--palette-graphite-sky-accent);
1285
+ --palette-main-accent-light: var(--palette-graphite-sky-accent-light);
1286
+ --palette-main-accent-deep: var(--palette-graphite-sky-accent-deep);
1287
+ --palette-main-on-accent: var(--palette-graphite-sky-on-accent);
1288
+ --palette-main-second: var(--palette-graphite-sky-second);
1289
+ }
1290
+
1291
+ .dark[data-palette="graphite-green"] {
1292
+ --palette-main-accent: var(--palette-graphite-green-accent);
1293
+ --palette-main-accent-light: var(--palette-graphite-green-accent-light);
1294
+ --palette-main-accent-deep: var(--palette-graphite-green-accent-deep);
1295
+ --palette-main-on-accent: var(--palette-graphite-green-on-accent);
1296
+ --palette-main-second: var(--palette-graphite-green-second);
1412
1297
  }
1413
1298
 
1414
1299
  /*
package/vite/index.d.ts CHANGED
@@ -36,7 +36,7 @@ export type PwaOptions = {
36
36
  * below default to its accent, its text on the accent and its background
37
37
  * instead of the light theme's.
38
38
  */
39
- palette?: 'indigo-cyan' | 'indigo-rose' | 'graphite-periwinkle' | 'violet' | 'palm-lcd'
39
+ palette?: 'graphite-periwinkle' | 'graphite-amber' | 'graphite-sky' | 'graphite-green' | 'palm-lcd'
40
40
  /** `#rrggbb`. Defaults to the package's `--primary` token (or the palette's accent). */
41
41
  themeColor?: string
42
42
  /** The letter's colour on the SVG icon, `#rrggbb`. Defaults to `--primary-foreground`. */
package/vite/pwa.js CHANGED
@@ -79,8 +79,14 @@ export function oklchToHex(value) {
79
79
  }
80
80
 
81
81
  // A palette's own colours for each token pwa() reads (styles/theme.css's
82
- // --palette-<name>-* primitives, already #rrggbb).
82
+ // --palette-<name>-* primitives, already #rrggbb). A graphite palette's
83
+ // greys are shared, as --palette-graphite-*.
83
84
  const PALETTE_PARTS = { primary: 'accent', 'primary-foreground': 'on-accent', background: 'background' }
85
+ const GRAPHITE_GREYS = new Set(['background'])
86
+
87
+ function palettePrimitive(palette, part) {
88
+ return palette.startsWith('graphite-') && GRAPHITE_GREYS.has(part) ? `palette-graphite-${part}` : `palette-${palette}-${part}`
89
+ }
84
90
 
85
91
  function colour(value, token, palette) {
86
92
  if (value !== undefined) {
@@ -89,7 +95,7 @@ function colour(value, token, palette) {
89
95
  }
90
96
  const css = fs.readFileSync(THEME_CSS, 'utf8')
91
97
  if (palette !== undefined) {
92
- const hex = themeToken(css, `palette-${palette}-${PALETTE_PARTS[token]}`)
98
+ const hex = themeToken(css, palettePrimitive(palette, PALETTE_PARTS[token]))
93
99
  if (!HEX.test(hex)) throw new Error(`pwa: no palette "${palette}" in the theme.`)
94
100
  return hex.toLowerCase()
95
101
  }