@designtools/tokens 0.6.0 → 0.7.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/CHANGELOG.md +37 -0
- package/README.md +50 -23
- package/dist/{chunk-UW2HXSV4.js → chunk-L73RTEAG.js} +301 -158
- package/dist/cli.js +169 -14
- package/dist/index.d.ts +135 -13
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
Notable changes to `@designtools/tokens`. Dates are release dates; versions follow semver, with breaking changes in the minor slot while the package is pre-1.0.
|
|
4
4
|
|
|
5
|
+
## 0.7.1
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- 637fc1f: Light muted sits a step under the canvas: still neutral-100 under the default canvas, but neutral-50 under a page given lighter than neutral-25 (`--canvas "#FFFFFF"`), where 100 read heavy.
|
|
10
|
+
- 55d3d36: Hover and press on a fill too near white to lighten (a pale yellow under black text) now darken it instead, rather than turning it white.
|
|
11
|
+
|
|
12
|
+
## 0.7.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- 3da728f: The focus ring, an input's edge and muted text are now searched to their contrast floor rather than fixed to a step: `ring` and `input` reach 3:1 against the canvas and the surface (WCAG 1.4.11), and `muted-foreground` reaches 4.5:1 on `muted` (7:1 with `--target aaa`). Each starts at its old step and moves away from the background until it clears; `border` keeps its fixed step. The chosen steps are recorded on the tokens (`utility[mode]._steps`, `muted._shades`), the CSS exports reference them, and `utilityShadeOverrides` now reaches the exports too, which it silently did not before. `--report` prints where each landed. Expect `--input`, `--ring` and `--muted-foreground` to move on regeneration; input edges in particular get noticeably darker.
|
|
17
|
+
- 3da728f: `--decorative <name>` (and `decorative` in the options, `"decorative": true` on a seed file's colour) gives an added colour its ramp and nothing else: no `--<name>`, `-foreground`, `-subdued` or `-highlight`, so no `bg-<name>` or `text-<name>-foreground`. An accent the brand forbids as text or an action is then decorative by construction, as `mxa-frontend-standards` describes. Without the flag, added colours keep their semantic slots as before.
|
|
18
|
+
|
|
19
|
+
- Light `muted` sits on neutral 100, a step off the canvas (25), so a muted panel or skeleton on the page is visible; it was the canvas colour.
|
|
20
|
+
- When no ramp step meets the contrast floor as a foreground, pure white or black is tried before a failing step is kept. A mid-tone grey seed (`#7A7468`) had its palest step at 4.27:1 where white passes at 4.63:1. Pairs that already passed are unchanged.
|
|
21
|
+
|
|
22
|
+
- Labels are chosen by what they sit on. On a fill: white or black, whichever contrasts more, or a tint off the ramp keeping at least 90% of that (`--foreground max` for none). Before, every label aimed for the step nearest 5.5:1, which dulled labels on dark fills (light blue on navy at 5.6:1 where white gives 10.4:1). On a subdued tint: the same hue, among steps keeping 80% of the ramp's peak chroma, aiming a level above the target (7:1 at AA in light mode, 9.5:1 in dark under WCAG, where WCAG 2 overstates light text on dark).
|
|
23
|
+
- When no label can reach the floor on a colour, the best available is kept, where a weaker ramp step was before.
|
|
24
|
+
- A status fill no label passes on both WCAG 2 and APCA moves up to two steps until one does: darker so white passes, or lighter when black is much nearer. A mid green now takes white at 6:1 and Lc 81, where it had black at Lc 49. The primary's own fill never moves.
|
|
25
|
+
- Dark mode keeps a light colour's own step (a pale yellow under a black label) instead of darkening it into khaki. Dark `subdued` is a dark tint (900 from a 500 seed) with a light same-hue label, not a pale 200 chip, and `subdued` stays near the ends of the ramp wherever the seed is anchored.
|
|
26
|
+
- `--contrast apca` holds every pairing to the WCAG 2 floor for the same target (`wcagFloor`, default true); `--no-wcag-floor` chooses by APCA alone. On eleven brands at AA, APCA alone failed 4.5:1 on a quarter of its pairings.
|
|
27
|
+
- Fills record the steps they settled on (`_shades`), the CSS exports reference them, and `--report` prints the chosen steps and every fill that moved, with its reason.
|
|
28
|
+
- The sRGB and P3 tiers judge a subdued label's hue the same way, so they pick the same step.
|
|
29
|
+
- The README no longer advises anchoring an extreme brand colour near the end of the ramp: the fill, highlight and subdued steps are placed relative to the anchor, so it pushed most of the palette to one side.
|
|
30
|
+
|
|
31
|
+
- **`highlight` is removed** (breaking). It sat two steps from the fill and read as a pressed state, not hover, and the industry's hover is a small change: a component thins its fill on hover and press (`hover:bg-primary/90`), keeping the label it was measured against. Each colour is now a fill and a subdued tint, each with its label.
|
|
32
|
+
- **Backgrounds.** `--canvas`, `--surface` and `--overlay` take exact colours per mode (`--canvas "#F2F2F0/#12171D"`; `surfaceColors` in the options), in place of the neutral steps they default to, and the text on each is measured. A brand's other section backgrounds come in by name (`--background stone=#E8E8DB`; `backgrounds`) as `--surface-<name>` with measured `-foreground`.
|
|
33
|
+
- **Every colour against every background.** `pageContrast` records each semantic fill and muted text against the canvas, surface, overlay and each named background, per mode, and `--report` prints the grid marked as fine for text, fine as a shape, or neither. Labels were checked only on their own fills, so red text on a dark page (2.4:1 for every brand tested) went unseen.
|
|
34
|
+
|
|
35
|
+
- Warning is an orange (hue 60°, from 75°). An amber's darker steps (a chip's label, text on the page) read as mustard and brown; an orange's stay burnt orange, clear of red at 25°.
|
|
36
|
+
- In light mode a warm colour (orange to yellow, warning or a yellow brand) carries its hue in a stronger tint (step 200) with a near-black label, because a label dark enough to read on a pale warm tint reads as brown or olive.
|
|
37
|
+
- A status colour's subdued label is guaranteed as text on every background of its mode (canvas, surface, overlay and each named background on the same side of mid-grey), so `-subdued-foreground` is the status text tone for the page. A named background of the other polarity (a dark section on a light page) is that mode scoped with `data-theme`, and is measured but not bound. The ring and an input's edge are searched against the same set.
|
|
38
|
+
|
|
39
|
+
- Hover and press are generated: `--<name>-hover` and `--<name>-active` move the fill 0.09 and 0.15 in lightness away from its label, so the state is plain and the label reads better on it. The 90% opacity hover was barely visible and dropped 26 of 90 labels under 4.5:1.
|
|
40
|
+
- `--usage <file>` (and `usageReport`) writes where each colour can go: every fill, status text tone and muted text on every background, per mode, as text, shape or neither. `@designtools/manifest` reads it as measured usage rules.
|
|
41
|
+
|
|
5
42
|
## 0.6.0
|
|
6
43
|
|
|
7
44
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Not a palette generator with extra steps. Most tools rotate hue and step lightne
|
|
|
10
10
|
|
|
11
11
|
This one works in **OKLCH**, so equal steps are equal *perceptual* steps and the ramps stay balanced without hand-tweaking. Lightness is a fraction of the headroom either side of your colour rather than a fixed position, so a pale tint and a near-black both get a usable scale. Chroma follows its own easing curve, so light tints stay clean instead of going muddy while the interactive range stays saturated.
|
|
12
12
|
|
|
13
|
-
And **every foreground is measured, not assumed.** For each background it generates, it
|
|
13
|
+
And **every foreground is measured, not assumed.** For each background it generates, it measures real contrast, WCAG or APCA, and picks the label by what the background is: the most contrast on a fill, the same hue a level above your target on a pale tint. `--report` prints what it achieved, so accessibility is something you can assert in CI rather than hope for:
|
|
14
14
|
|
|
15
15
|
```
|
|
16
16
|
light mode (wcag, target aa)
|
|
@@ -33,17 +33,22 @@ From a single seed colour:
|
|
|
33
33
|
--color-primary-950: oklch(17.50% 0.0766 215.79);
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
**Semantic intents** — what you actually write in components. Each of `primary`, `neutral`, `success`, `destructive`, `warning` gets
|
|
36
|
+
**Semantic intents** — what you actually write in components. Each of `primary`, `neutral`, `success`, `destructive`, `warning` gets a fill and a subdued tint, each with its label, plus a `muted` pair:
|
|
37
37
|
|
|
38
38
|
```css
|
|
39
39
|
--primary --primary-foreground
|
|
40
40
|
--primary-subdued --primary-subdued-foreground
|
|
41
|
-
--primary-highlight --primary-highlight-foreground
|
|
42
41
|
```
|
|
43
42
|
|
|
44
|
-
Every `-foreground` is chosen by
|
|
43
|
+
Every `-foreground` is chosen by rule and measured, not a fixed mapping (see [Foregrounds](#foregrounds-are-chosen-by-what-they-sit-on)). Hover and press are `--primary-hover` and `--primary-active` (see below). `highlight`, which sat two steps from the fill and read as pressed rather than hover, was removed in 0.7.0.
|
|
45
44
|
|
|
46
|
-
**Surfaces and utilities** — `--canvas`, `--surface`, `--overlay` with paired foregrounds, plus `--border`, `--input`, `--ring`, `--shadow`.
|
|
45
|
+
**Surfaces and utilities** — `--canvas`, `--surface`, `--overlay` with paired foregrounds, plus `--border`, `--input`, `--ring`, `--shadow`. The three backgrounds default to neutral steps and take exact colours per mode (`--canvas "#F2F2F0/#12171D"`); a brand's other section backgrounds come in by name (`--background stone=#E8E8DB`) as `--surface-stone` with measured text.
|
|
46
|
+
|
|
47
|
+
**Hover and press are generated.** Each fill gets `--<name>-hover` and `--<name>-active`: the fill moved 0.09 and 0.15 in lightness away from its label (darker under a white label, lighter under a black one), so the change is plain to see and the label reads better on it, never worse. The 90% opacity they replace was barely visible (median ΔE 4.7) and dropped 26 of 90 labels under 4.5:1 by letting the page show through.
|
|
48
|
+
|
|
49
|
+
**Status text on the page is the subdued label.** `--success-subdued-foreground` and its siblings are guaranteed to read as text on every background of their mode, so an error message is `text-destructive-subdued-foreground`, not `text-destructive` (the fill, measured only against its own label). A warning on the page is neutral text with an icon: warning is an orange, and orange dark enough to be text reads as brown. In light mode warning, and any yellow or orange brand colour, carries its hue in a stronger tint (step 200) with a near-black label for the same reason.
|
|
50
|
+
|
|
51
|
+
**Every colour against every background.** A label is checked on its own fill; `pageContrast` (and `--report`) measures the rest: each semantic fill and muted text against the canvas, surface, overlay and each named background, per mode, so red text on a dark page (2.4:1 for every brand tested) or a deep purple button on a dark canvas (1.2:1) shows up before it ships. Read it as text (4.5:1 at AA) or as a shape (3:1, WCAG 1.4.11): a button's own label makes its outline optional, a meter fill or a switch has no label to lean on.
|
|
47
52
|
|
|
48
53
|
**Light and dark**, derived independently from the same ramps rather than one being a transform of the other, with contrast re-checked per mode. Output is keyed on `[data-theme]` with a `prefers-color-scheme` fallback, so it works with or without a theme toggle:
|
|
49
54
|
|
|
@@ -106,16 +111,22 @@ Contrast is measured on the colour that is displayed, too. A browser maps an out
|
|
|
106
111
|
|
|
107
112
|
For wide-gamut displays there is [`--gamut p3`](#--gamut--which-displays).
|
|
108
113
|
|
|
109
|
-
### Foregrounds are
|
|
114
|
+
### Foregrounds are chosen by what they sit on
|
|
115
|
+
|
|
116
|
+
- **On a fill** (`DEFAULT`): the fill carries the hue, so the label's job is to be read. It is white or black, whichever contrasts more; a tint off the colour's ramp or the neutral may stand in only if it keeps at least 90% of that contrast, so the label is warmed towards the brand, never dulled. `--foreground max` allows no tint.
|
|
117
|
+
- **On a subdued tint**: the label carries the hue (green for paid, red for overdue), so it stays on its own ramp, among steps that keep at least 80% of the ramp's peak chroma, and aims a level above the target: 7:1 at AA and 9:1 at AAA in light mode, 9.5:1 at AA in dark mode under WCAG, because WCAG 2 overstates light text on a dark ground (Lc 75 and 90 under APCA). Keeping the hue never costs more than half the way from the floor to the aim.
|
|
118
|
+
- **When no label can reach the floor** on a colour, the best available is kept and `--report` shows the failure: only a different fill can do better.
|
|
110
119
|
|
|
111
|
-
|
|
120
|
+
Before 0.7.0 every label aimed for the shade nearest a comfort target (5.5:1 at AA), which dulled labels on dark fills: light blue on navy at 5.6:1, where white gives 10.4:1.
|
|
121
|
+
|
|
122
|
+
**A fill no label can pass on both measures moves.** On a mid-tone fill WCAG 2 and APCA disagree: on a mid green (luminance 31%) black scores 7.2:1 but Lc 49, and white Lc 60 but 2.9:1. A status fill like that (any but the primary's own, which is the brand colour) moves up to two steps until a label passes both: darker until white does, or lighter until black does when black is much nearer. The thresholds are fill luminance, measured from APCA once, so the result is the same whether or not APCA is installed. `--report` lists every fill that moved and why.
|
|
112
123
|
|
|
113
124
|
- **WCAG 2.x** (default) — `(L₁ + 0.05) / (L₂ + 0.05)`, with floors of 3:1 (`--target aa-large`), 4.5:1 (`aa`) and 7:1 (`aaa`). Widely adopted and legally referenced, but it treats dark-on-light and light-on-dark identically and has no concept of text size.
|
|
114
|
-
- **APCA** (`--contrast apca`) — models how contrast is actually perceived, so the same two colours score differently depending on which one is the text. Bands at Lc 45 (large text), Lc 60 (larger content), Lc 75 (body text), Lc 90 (fluent reading). Needs [`apca-w3`](#apca-is-optional) installed.
|
|
125
|
+
- **APCA** (`--contrast apca`) — models how contrast is actually perceived, so the same two colours score differently depending on which one is the text. Bands at Lc 45 (large text), Lc 60 (larger content), Lc 75 (body text), Lc 90 (fluent reading). Needs [`apca-w3`](#apca-is-optional) installed. Every pairing it picks must also pass the WCAG 2 floor for the same target, which is what audits measure: on eleven brands at AA, APCA alone failed 4.5:1 on a quarter of its pairings. `--no-wcag-floor` drops the floor.
|
|
115
126
|
|
|
116
127
|
### Dark mode is derived, not inverted
|
|
117
128
|
|
|
118
|
-
Both modes come from the same ramps via different shade mappings, and the contrast search re-runs for each — so a dark foreground is chosen against dark backgrounds rather than inherited from a flipped light palette.
|
|
129
|
+
Both modes come from the same ramps via different shade mappings, and the contrast search re-runs for each — so a dark foreground is chosen against dark backgrounds rather than inherited from a flipped light palette. A dark-mode fill steps one darker than light mode's, so a white label gains contrast; a light colour under a black label (a pale yellow) keeps its own step, because darker would only weaken the label and muddy the colour. Dark `subdued` is a dark tint with a light label in the same hue, not a pale chip.
|
|
119
130
|
|
|
120
131
|
### Status colours belong to your palette
|
|
121
132
|
|
|
@@ -279,6 +290,7 @@ With `gamut: "p3"`, the wide-gamut tiers are on `tokens.p3`, and the checks take
|
|
|
279
290
|
| `--primary <colour>` | — | Your brand colour. Required unless `--seed` supplies it. |
|
|
280
291
|
| `--neutral <colour>` | `#747474` | Neutral seed. Drives greys, surfaces, borders. |
|
|
281
292
|
| `--color <name>=<colour>[@<shade>]` | — | An extra named scale. Repeatable. `@<shade>` anchors its seed on that step. |
|
|
293
|
+
| `--decorative <name>` | — | Give an added colour its ramp only, with no semantic slots (`--<name>`, `-foreground`, `bg-<name>`), so an accent that must never be text or an action cannot be used as one. Repeatable. In a seed file, `"decorative": true` on the colour. |
|
|
282
294
|
| `--seed <file.json>` | — | Replay a saved configuration. Flags given alongside it win, so a seed is defaults rather than a lock. |
|
|
283
295
|
| `--stdin` | off | Read that same JSON from standard input. |
|
|
284
296
|
|
|
@@ -308,6 +320,11 @@ A seed file:
|
|
|
308
320
|
| `--contrast` | `wcag` · `apca` | `wcag` | Which algorithm picks foregrounds. `apca` needs [`apca-w3`](#apca-is-optional) installed. |
|
|
309
321
|
| `--target` | `aa-large` · `aa` · `aaa` | `aa` | Minimum the foreground search must clear. |
|
|
310
322
|
| `--lightness` | `fixed` · `perceptual` | `fixed` | How lightness is spread across the steps. |
|
|
323
|
+
| `--foreground` | `balanced` · `max` | `balanced` | Labels on a fill: white or black, or a tint keeping 90% of that (`balanced`); never a tint (`max`). |
|
|
324
|
+
| `--no-wcag-floor` | — | — | With `--contrast apca`, choose by APCA alone, without holding pairings to the WCAG 2 floor. |
|
|
325
|
+
| `--canvas`, `--surface`, `--overlay` | `<colour>[/<dark>]` | neutral steps | The page, card and overlay as exact colours, light then dark; text on each is measured. |
|
|
326
|
+
| `--background` | `<name>=<colour>[/<dark>]` | — | A brand section background, emitted as `--surface-<name>` with measured text. Repeatable. |
|
|
327
|
+
| `--usage <file.json>` | — | — | Also write where each colour can go: every fill, status text tone and muted text on every background, per mode, as text, shape or neither (`designtools.usage/1`). `@designtools/manifest` turns the failures into measured usage rules. `--check` compares it too. |
|
|
311
328
|
| `--seed-shade` | `25`…`950` | `500` | Which step your primary lands on. |
|
|
312
329
|
| `--neutral-seed-shade` | `25`…`950` | `500` | Which step your neutral lands on. |
|
|
313
330
|
| `--gamut` | `srgb` · `p3` | `srgb` | Which displays to generate for. |
|
|
@@ -316,11 +333,10 @@ A seed file:
|
|
|
316
333
|
|
|
317
334
|
#### `--seed-shade` — where your brand colour sits
|
|
318
335
|
|
|
319
|
-
Everything is derived from the headroom above and below the seed, so where it sits matters.
|
|
336
|
+
Everything is derived from the headroom above and below the seed, so where it sits matters, but leave it on 500 unless a step you use looks wrong. The fill, subdued and ring steps are all placed relative to the anchor: anchor a pale yellow at 50 and everything darker than it, which the dark-mode fill and any tint labels draw on, is khaki; anchor a deep purple at 800 and its mid tones go grey. On 500 an extreme seed looks lopsided at one end (a pale yellow's 25 to 400 are near-identical creams), which costs little, because those steps are only read for subdued tints. When a used step is wrong, a nudge within 400 to 600 or a shade override for that one slot is the better fix.
|
|
320
337
|
|
|
321
338
|
```bash
|
|
322
|
-
generate-tokens --primary "#1e3a5f" --seed-shade
|
|
323
|
-
generate-tokens --primary "#fde68a" --seed-shade 200 # pale amber belongs near the top
|
|
339
|
+
generate-tokens --primary "#1e3a5f" --seed-shade 600 # a deep navy, one step down for more headroom
|
|
324
340
|
```
|
|
325
341
|
|
|
326
342
|
Your colour is still reproduced exactly, just at the step you name. The ramp keeps its shape — gentle at the light end, larger jumps at the dark end for text contrast — and peak chroma follows the seed.
|
|
@@ -335,16 +351,18 @@ generate-tokens --primary "#fde68a" --seed-shade 200 \
|
|
|
335
351
|
|
|
336
352
|
Before 0.5.0, `--seed-shade` moved every family. A pale brand colour anchored at 200 dragged the neutral to 200 with it, so `#CECECE` became `neutral-200` and the whole grey ramp darkened. A pale brand does not imply a pale grey.
|
|
337
353
|
|
|
338
|
-
**The semantics follow the anchor too.** `--primary`, its subdued
|
|
354
|
+
**The semantics follow the anchor too.** `--primary`, its subdued tint, and where `--ring` starts are positions relative to the seed, not fixed steps, and every other family's semantics are relative to that family's own anchor — so `bg-primary` is your brand colour wherever you anchor it. Before 0.4.0 they were pinned to 500, which meant anchoring a deep navy at 800 left `--primary` pointing at a pale mid-tone the brand never chose, with no way to reach the real one through `bg-primary` at all.
|
|
339
355
|
|
|
340
356
|
`muted`, `border`, `input` and `shadow` stay where they are: they read the neutral ramp, not your brand, and re-anchoring the whole UI's greys is a different thing from placing a brand colour.
|
|
341
357
|
|
|
358
|
+
**Three tokens are searched to a contrast floor.** The focus ring and an input's edge are non-text UI that WCAG 1.4.11 holds to 3:1, and muted text is text. A fixed step meets those for some colours and not others, so each starts at its usual step and moves away from the background (darker in light mode, lighter in dark) until it clears its floor against the canvas and the surface: 3:1 for `ring` and `input`, 4.5:1 for `muted-foreground` (7:1 with `--target aaa`). `border` keeps its fixed step, because round a card it is decoration. An override in `utilityShadeOverrides` still wins. Before 0.7.0 these were fixed, and a teal brand on a warm grey shipped a 2.7:1 ring, a 1.6:1 input edge and 4.3:1 muted text.
|
|
359
|
+
|
|
342
360
|
`--report` prints where the bridge landed, so you can check rather than infer:
|
|
343
361
|
|
|
344
362
|
```
|
|
345
|
-
semantic bridge for primary, anchored at
|
|
346
|
-
light default
|
|
347
|
-
dark default
|
|
363
|
+
semantic bridge for primary, anchored at 600 (other families at 500)
|
|
364
|
+
light default 600 subdued 100
|
|
365
|
+
dark default 700 subdued 950
|
|
348
366
|
```
|
|
349
367
|
|
|
350
368
|
#### `--shades` — which steps exist
|
|
@@ -356,11 +374,10 @@ generate-tokens --primary "#4e9caf" --shades tailwind # 50–950
|
|
|
356
374
|
generate-tokens --primary "#4e9caf" --shades 100,500,900 # a coarse three-step ramp
|
|
357
375
|
```
|
|
358
376
|
|
|
359
|
-
Some tokens name specific steps
|
|
377
|
+
Some tokens name specific steps (light `canvas` sits on 25), so dropping a step could leave a `var()` pointing at nothing. References snap to the nearest emitted step instead, and every substitution is reported, because snapping quietly changes a design decision:
|
|
360
378
|
|
|
361
379
|
```
|
|
362
380
|
--shades 50,100,…,950 drops steps some tokens name; snapped to nearest:
|
|
363
|
-
muted (light): 25 -> 50
|
|
364
381
|
canvas (light): 25 -> 50
|
|
365
382
|
```
|
|
366
383
|
|
|
@@ -435,14 +452,24 @@ Supported by `css`, `tailwind-v4` and `json`; other formats reject it rather tha
|
|
|
435
452
|
| Flag | What it does |
|
|
436
453
|
|---|---|
|
|
437
454
|
| `--check` | Compare against what is already at `--out`. Writes nothing; exits non-zero on drift. With `--ramps` or `--merge`, only the declarations this run generates are compared. |
|
|
438
|
-
| `--report` | Print where the semantic bridge landed, peak chroma per ramp, and measured contrast for every pairing — semantic, surface and utility — with a score. Stderr only; never changes the exit code. |
|
|
455
|
+
| `--report` | Print where the semantic bridge landed, where the searched tokens landed, peak chroma per ramp, and measured contrast for every pairing — semantic, surface and utility — with a score. Stderr only; never changes the exit code. |
|
|
439
456
|
|
|
440
457
|
```
|
|
441
458
|
$ generate-tokens --primary "#4e9caf" --report --out tokens.css
|
|
442
459
|
|
|
443
|
-
semantic bridge
|
|
444
|
-
|
|
445
|
-
|
|
460
|
+
semantic bridge for primary, anchored at 500 (other families at 500)
|
|
461
|
+
semantic bridge for primary, anchored at 500 (other families at 500)
|
|
462
|
+
light default 500 subdued 50
|
|
463
|
+
|
|
464
|
+
fills moved from the offset table
|
|
465
|
+
light success fill 500 -> 600 (no label passed both WCAG 2 and APCA)
|
|
466
|
+
light warning fill 500 -> 400 (no label passed both WCAG 2 and APCA)
|
|
467
|
+
dark primary fill 600 -> 500 (a light colour under a black label keeps its own step)
|
|
468
|
+
...
|
|
469
|
+
|
|
470
|
+
searched to their contrast floor (ring and input 3:1 on canvas and surface; muted text on muted)
|
|
471
|
+
light ring primary-600 (from 400) input neutral-500 (from 200) muted-foreground neutral-600 (from 500)
|
|
472
|
+
dark ring primary-600 (from 700) input neutral-500 (from 800) muted-foreground neutral-200
|
|
446
473
|
|
|
447
474
|
ramp chroma (peak C per family)
|
|
448
475
|
primary 0.0815 at 500
|
|
@@ -457,7 +484,7 @@ light mode (wcag, target aa)
|
|
|
457
484
|
|
|
458
485
|
light surfaces and utilities (wcag, not counted in the score)
|
|
459
486
|
AAA canvas/foreground 13.05:1
|
|
460
|
-
|
|
487
|
+
3:1 ring/canvas 4.33:1 (non-text, 1.4.11)
|
|
461
488
|
border/canvas 1.29:1 (advisory: 3:1 only where it bounds a control)
|
|
462
489
|
```
|
|
463
490
|
|