@brignano/design 0.12.1 → 0.14.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.
Files changed (53) hide show
  1. package/DESIGN.md +179 -23
  2. package/README.md +51 -3
  3. package/components.css +249 -249
  4. package/controls.css +2251 -0
  5. package/decisions/0001-cobalt.md +1 -1
  6. package/decisions/0008-cobalt-hue-256.md +1 -1
  7. package/decisions/0014-identity.md +1 -1
  8. package/decisions/0015-white-label-on-cobalt.md +1 -1
  9. package/decisions/0017-product-identity.md +1 -1
  10. package/decisions/0019-house-theme-shell.md +51 -0
  11. package/decisions/0020-kits-opt-in.md +56 -0
  12. package/decisions/README.md +2 -0
  13. package/kits/larch.css +125 -0
  14. package/kits/ledger.css +121 -0
  15. package/kits/split.css +123 -0
  16. package/package.json +13 -2
  17. package/product-page.css +82 -82
  18. package/scripts/colour.mjs +42 -0
  19. package/scripts/theme.mjs +190 -0
  20. package/tailwind.css +13 -20
  21. package/templates/app-shell.css +15 -15
  22. package/templates/article.css +26 -26
  23. package/templates/changelog.css +9 -9
  24. package/templates/email.html +3 -3
  25. package/templates/error.css +7 -7
  26. package/templates/legal.css +11 -11
  27. package/templates/settings.css +9 -9
  28. package/themes/driftwood.css +109 -0
  29. package/themes/driftwood.theme +5 -0
  30. package/themes/guidebook.css +104 -0
  31. package/themes/guidebook.theme +5 -0
  32. package/themes/homelab.css +101 -0
  33. package/themes/homelab.theme +2 -0
  34. package/themes/receipts.css +101 -0
  35. package/themes/receipts.theme +2 -0
  36. package/themes/sites.css +106 -0
  37. package/themes/sites.theme +7 -0
  38. package/tokens/base.css +37 -0
  39. package/tokens/chart.json +145 -0
  40. package/tokens/color.json +840 -0
  41. package/tokens/component.json +75 -0
  42. package/tokens/head.css +84 -0
  43. package/tokens/kits/larch.json +255 -0
  44. package/tokens/kits/ledger.json +247 -0
  45. package/tokens/kits/split.json +247 -0
  46. package/tokens/motion.json +38 -0
  47. package/tokens/names.d.ts +246 -0
  48. package/tokens/shape.json +56 -0
  49. package/tokens/space.json +99 -0
  50. package/tokens/tailwind.json +343 -0
  51. package/tokens/type.json +206 -0
  52. package/tokens.chart.css +23 -23
  53. package/tokens.css +278 -136
package/DESIGN.md CHANGED
@@ -33,7 +33,7 @@ family, motion and shape are identical; what changes is how much room things get
33
33
  |---|---|---|
34
34
  | Opt in | `class="tier-marketing"` on `<html>` | default, no class |
35
35
  | Body size | 17px | 15px |
36
- | Section rhythm | `--s9` (96px) | `--s6` (32px) |
36
+ | Section rhythm | `--space-9` (96px) | `--space-6` (32px) |
37
37
  | Measure | 68ch | 780px |
38
38
  | Display face | Silkscreen — hero eyebrows | none (aliases to `--sans`) |
39
39
  | Motion | scroll reveal, overlays opening and closing (ADR-0013), a press and a switch of view (ADR-0015) | none, except overlays opening and closing (ADR-0013), a press and a switch of view (ADR-0015) |
@@ -50,7 +50,7 @@ Every hue answers exactly one question, on every surface, in both tiers:
50
50
  | Token | Answers | Hue |
51
51
  |---|---|---|
52
52
  | neutral ramp | the page itself | cool grey |
53
- | `--i-*` | *you can act on this* | cobalt |
53
+ | `--action-*` | *you can act on this* | cobalt |
54
54
  | `--success` | *settled, confirmed, done* | forest |
55
55
  | `--attention` | *this wants you* | larch amber |
56
56
  | `--danger` | *this has gone wrong* | rust |
@@ -107,18 +107,18 @@ graphic (ADR-0017). There, and only there, it may do two more things:
107
107
  - **Fill the one primary button**: `--mark-fill` under a white `--on-mark`
108
108
  label, stepping darker to `--mark-fill-hover` and `--mark-fill-pressed`.
109
109
  - **Wash the page ground**: `--mark-surface`, a faint opaque tint that
110
- `--ink`, `--ink-soft` and links in `--i-ink` all read on.
110
+ `--ink`, `--ink-soft` and links in `--action-ink` all read on.
111
111
 
112
112
  `data-mark` points all four at the product's, as it does `--mark-current`;
113
113
  with no attribute they are the family amber. The fill is its own step, the
114
- way `--i` sits beside `--i-ink`: in light it is the mark (amber is deepened
114
+ way `--action` sits beside `--action-ink`: in light it is the mark (amber is deepened
115
115
  to carry the label), in dark it is the mark's hue as light as a white label
116
116
  allows. Never fill or wash with
117
117
  `--mark-teal` and its siblings directly: in dark they are pale, for drawing.
118
118
 
119
119
  This is a scoped exception to "identity is not a fill", as the stage behind a
120
120
  hero proof was (ADR-0011). It never reaches an app, a link, text or a state,
121
- and the focus ring stays `--i-ink`.
121
+ and the focus ring stays `--action-ink`.
122
122
 
123
123
  ### On a card that stands for a product, the stage
124
124
 
@@ -131,7 +131,7 @@ without a product page has none and stays on the family amber.
131
131
 
132
132
  The stage is the picture's ground and nothing else. On that card the mark
133
133
  still never colours a button, link, text, chip, badge, border or state, and
134
- the focus ring stays `--i-ink`. A card that doesn't stand for a product (a
134
+ the focus ring stays `--action-ink`. A card that doesn't stand for a product (a
135
135
  trip, a post) never gets a stage.
136
136
 
137
137
  ### Colour is a surface, not text
@@ -169,26 +169,26 @@ type is already carried by a text label. Nor `idea`, `planning`, `someday`, or
169
169
 
170
170
  The part that makes an interface feel built rather than styled.
171
171
 
172
- - `--i` fill, `--i-hover`, `--i-pressed`, `--i-ink` for links/icons/focus. The
173
- fill is a saturated cobalt with a white label (`--on-i`) in both themes, and
172
+ - `--action` fill, `--action-hover`, `--action-pressed`, `--action-ink` for links/icons/focus. The
173
+ fill is a saturated cobalt with a white label (`--on-action`) in both themes, and
174
174
  hover and pressed step darker in both. In dark the fill and the ink are
175
- different steps: fill a surface with `--i`, write or draw on a surface with
176
- `--i-ink`, and a hovered link takes `--i-ink-hover`, never the fill's hover. A destructive button fills with `--danger-fill` (and its
175
+ different steps: fill a surface with `--action`, write or draw on a surface with
176
+ `--action-ink`, and a hovered link takes `--action-ink-hover`, never the fill's hover. A destructive button fills with `--danger-fill` (and its
177
177
  `-hover` and `-pressed` steps) under a white `--on-danger` label, not with
178
178
  the state hue `--danger`, which in dark is a pale rust for reading.
179
- - **Disabled is neutral, never hued** (`--i-disabled-bg` / `--i-disabled-ink`). A
179
+ - **Disabled is neutral, never hued** (`--disabled` / `--disabled-ink`). A
180
180
  greyed-out control must stop signalling "click me". Its low contrast is allowed
181
181
  only because WCAG 1.4.3 exempts *inactive* controls, so the state must be real:
182
182
  `disabled` on a button or input, `aria-disabled="true"` otherwise. Disabled
183
183
  styling on an element that isn't marked disabled is just low-contrast text.
184
- - Focus is always visible: 2px `--i-ink` outline, 2px offset. Never remove it.
184
+ - Focus is always visible: 2px `--action-ink` outline, 2px offset. Never remove it.
185
185
  - Hover and pressed surfaces on neutral elements come from `--surface-hover` and
186
186
  `--surface-active`, not from opacity tricks.
187
187
  - A control's own edge — an input, a secondary button — is `--line-control`
188
188
  (≥ 3:1). `--line-strong` is a divider, too faint to tell you a control is there.
189
189
  - Checkboxes and radios in a `.choice` row are drawn from tokens
190
190
  (`components.css`), so they look the same on every OS. Bare ones, ranges and
191
- progress bars stay native and inherit `accent-color: var(--i)` from
191
+ progress bars stay native and inherit `accent-color: var(--action)` from
192
192
  `tokens.css`; don't restyle those just to recolour them. `.progress` and
193
193
  `.meter` on a native `<progress>` or `<meter>` draw it from tokens, for
194
194
  when a bar must look the same everywhere.
@@ -275,16 +275,21 @@ avoids a one-word last line (`pretty`). On a touch screen the tool tier's
275
275
 
276
276
  ## 6. Space, shape, elevation
277
277
 
278
- 4px base (`--s1` … `--s9`). Radius steps by what the thing is, so a control
278
+ 4px base (`--space-1` … `--space-9`). Radius steps by what the thing is, so a control
279
279
  inside a card reads as nested rather than as a smaller card: `--radius-sm`
280
280
  (6px) for chips and pills, `--radius-control` (8px) for buttons, inputs,
281
- selects, the segmented control and menu items, `--radius` (12px) for cards,
281
+ selects, the segmented control and menu items, `--radius-card` (12px) for cards,
282
282
  messages, popovers and code blocks, `--radius-lg` (18px) for dialogs and
283
283
  hero surfaces.
284
284
 
285
285
  **Elevation differs by theme.** Light mode separates surfaces with a hairline plus
286
286
  a shadow (`--shadow-1/2/3`). Dark mode does not use borders — surfaces get
287
287
  *lighter* with elevation. This is why `--line` can stay nearly invisible in dark.
288
+ A card is the exception to a faint hairline in light: `--line` all but
289
+ vanishes between a white card and the page, so a grid of cards read as one
290
+ sheet. `.card` reads `--card-line` (one step up, neutral-200) and
291
+ `--card-shadow` (`--shadow-2`); a kit whose `--line` already shows sets both
292
+ back to `--line` and `--shadow-1`.
288
293
 
289
294
  **Stacking** is named, not numbered: `--z-raised` (a control above its card's
290
295
  stretched link), `--z-sticky` (a header), `--z-float` (a floating label),
@@ -330,7 +335,7 @@ except the overlay case below.
330
335
  **The second: overlays may move as they open and close, in both tiers**
331
336
  (ADR-0013). A dialog, sheet, popover, menu or toast that someone opened, or that answers what they
332
337
  just did, fades and slides a few pixels (a sheet from its own edge) over
333
- `--dur-fast`. Only opacity and transform move; the open state is always fully
338
+ `--duration-fast`. Only opacity and transform move; the open state is always fully
334
339
  shown, so a browser without `@starting-style` shows it at once; and under
335
340
  `prefers-reduced-motion` it is instant, backdrop included. An overlay that is
336
341
  already open when the page loads doesn't animate. That is the whole
@@ -339,12 +344,12 @@ exception: content on the page itself still never animates in.
339
344
  **The third: a control may answer the person who used it** (ADR-0015). Two
340
345
  cases, both only ever started by the person:
341
346
 
342
- - **A press.** A `.btn` settles by 2% over `--dur-fast` while it is held down. Not when it is
347
+ - **A press.** A `.btn` settles by 2% over `--duration-fast` while it is held down. Not when it is
343
348
  disabled or busy.
344
349
  - **A switch of view.** When someone picks a tab or a segment, the script that
345
350
  swaps the content may wrap the swap in `document.startViewTransition()`, and
346
351
  the old view cross-fades to the new one at the browser's default, 250ms
347
- (the same as `--dur`). The package sets nothing on the transition, so a
352
+ (the same as `--duration`). The package sets nothing on the transition, so a
348
353
  site that already uses view transitions is not affected. Opt in per switch;
349
354
  a browser without the API swaps at once.
350
355
 
@@ -379,7 +384,7 @@ the chart exception: node *type* is a category like event type, and is carried b
379
384
  an icon and a label, never a hue. A diagram where every node is tinted by family
380
385
  is thirty coloured things, and the one that is down disappears among them.
381
386
 
382
- - **Nodes are neutral.** `--card` fill, `--line-strong` edge, `--radius` corners,
387
+ - **Nodes are neutral.** `--card` fill, `--line-strong` edge, `--radius-card` corners,
383
388
  an icon in `--ink-soft`, the name in `--ink`, the kind in `--mono` at
384
389
  `--text-xs` in `--ink-soft`. Grouping is a zone: `--line` hairline, no fill or
385
390
  a faint one, a `--mono` eyebrow label.
@@ -401,7 +406,7 @@ is thirty coloured things, and the one that is down disappears among them.
401
406
  `--code-string` (`--ink-soft`), comments `--code-comment` (`--slate`, italic),
402
407
  everything else `--code-ink`. A highlighted line is `--code-highlight`. No
403
408
  syntax rainbow: a reader scanning code needs the keywords, not a palette.
404
- - **Selection** is the focus treatment: a 2px `--i-ink` outline, offset. Asking
409
+ - **Selection** is the focus treatment: a 2px `--action-ink` outline, offset. Asking
405
410
  "what depends on this?" dims everything unrelated to ~30% opacity and inks the
406
411
  connecting edges in `--ink`; it never introduces a colour.
407
412
  - **A path is numbered, not coloured.** A request path drawn over a diagram
@@ -422,7 +427,7 @@ is thirty coloured things, and the one that is down disappears among them.
422
427
  Non-negotiable in both themes:
423
428
 
424
429
  - Body text ≥ 4.5:1; large text and UI marks ≥ 3:1. `--slate` is the quietest
425
- text step and clears 4.5:1 in both themes; `--n-500` in light does not, so it
430
+ text step and clears 4.5:1 in both themes; `--neutral-500` in light does not, so it
426
431
  is never text.
427
432
  - Touch targets ≥ 44px on coarse pointers, with a `.touch-hit` opt-out for controls
428
433
  whose shape is meaningful (a 22px circular checkbox forced to 44px becomes an
@@ -434,6 +439,88 @@ Non-negotiable in both themes:
434
439
 
435
440
  ## 11. Themes, and integrating with a Tailwind consumer
436
441
 
442
+ ### Kits
443
+
444
+ A kit is a whole look: ground, text, the action colour, typefaces, corners and
445
+ elevation. Three ship, Split, Ledger and Larch (ADR-0019), each as
446
+ `kits/<kit>.css`, generated from `tokens/kits/<kit>.json`. **They are opt-in
447
+ until 1.0** (ADR-0020): today's look is the default, and `data-kit="split"` on
448
+ `<html>`, or on any element, gives that subtree the kit.
449
+
450
+ - **A kit sets only names `:root` defines.** A component never asks which kit
451
+ it is in; it reads the same token and gets the kit's value.
452
+ - **One hue acts, another says "settled".** A kit's `--action` stays at least
453
+ 25° from `--success`. State hues are the same in every kit.
454
+ - **A fill's label is `--on-action`**, whatever reads on it: ink on Split's
455
+ lime, the page on Ledger's ink.
456
+ - **The primary is found by its fill or its edge.** `--action-edge` is the
457
+ fill, except Split in light, where lime can't be found on white and the edge
458
+ is ink. There `--action` is a fill only; a mark, a line or a link takes
459
+ `--action-ink`.
460
+ - **The display treatment reads the kit**: `--display`, `--weight-heavy`,
461
+ `--display-case` and `--display-stretch` (Split sets capitals and a wide cut).
462
+ - **A step of the type scale is three tokens**: `--text-N`, `--leading-N`,
463
+ `--tracking-N`.
464
+ - **Density.** `data-density="compact"` tightens `--control-height` for a
465
+ dense tool screen. Touch targets stay 44px.
466
+
467
+ `npm run check` measures every kit, both schemes, against every token floor
468
+ the default look is held to, plus its washes and the gap between act and
469
+ settled. A kit may not set a state colour.
470
+
471
+ ### Product themes
472
+
473
+ A product's look is a file of a few lines, `themes/<product>.theme`
474
+ (ADR-0019). `npm run build` lays it over its kit and writes
475
+ `themes/<product>.css`, one rule under `[data-product='<product>']`, so a
476
+ product imports one file and sets one attribute. Opt-in until 1.0, like kits.
477
+
478
+ ```
479
+ kit: larch # split, ledger or larch: the look it starts from
480
+ ground: wash # plain (the kit's), bright, or wash
481
+ scheme: dark # both (the default) or dark, which pins the product dark
482
+ hue: 355 # what acts: an OKLCH hue, 0 to 360
483
+ typeface: onest # headings; `mono` sets everything in the kit's mono
484
+ heading-weight: 500
485
+ corners: 16 # px, or `pill`
486
+ shell: conversation # console, canvas, player, conversation, document
487
+ ```
488
+
489
+ Those eight keys are all there are. A key left out takes the kit's value.
490
+
491
+ **To add a product:** write its `.theme`, run `npm run build`, import
492
+ `@brignano/design/themes/<product>.css`, set `data-product="<product>"` on
493
+ `<html>`, and load the kit's fonts (README). Nothing else: no CSS, no palette.
494
+
495
+ **A theme is a hue, never a palette.** Every colour a theme sets is a fixed
496
+ step of lightness and chroma at its hue, written once in
497
+ `scripts/theme.mjs`:
498
+
499
+ - `ground: bright` is a near-white page with white cards; `wash` is a page
500
+ tinted with the hue and lighter cards on it. Text and lines take the hue too.
501
+ - On Split the hue is a **signal**: a bright fill with an ink label, the same
502
+ in both schemes, and an ink edge wherever the fill can't be found on the
503
+ page. On Ledger and Larch it is **deep**: a deep fill with a light label in
504
+ light, a pale fill with a dark label in dark.
505
+ - State colours are never a theme's to set, and are the same in every one.
506
+
507
+ **It can't make an unreadable theme.** The build refuses a theme whose text
508
+ is under 4.5:1 or whose controls are under 3:1, naming the pair and the
509
+ ratio. `npm run check` proves every hue, on every kit and ground, passes that
510
+ gate (648 combinations), and holds each built theme to every token floor.
511
+
512
+ Measured, light / dark (Driftwood is dark only):
513
+
514
+ | Theme | Text on page | Muted on a surface | Button label | Link on page | Primary found | Control edge |
515
+ |---|---|---|---|---|---|---|
516
+ | homelab | 18.34 / 17.48 | 6.01 / 6.82 | 14.89 / 14.89 | 18.34 / 17.48 | 18.34 / 15.22 | 18.34 / 17.48 |
517
+ | driftwood | 17.48 | 6.82 | 12.29 | 17.48 | 12.56 | 17.48 |
518
+ | guidebook | 16.53 / 17.06 | 7.10 / 7.37 | 6.39 / 9.99 | 6.12 / 9.99 | 6.12 / 9.99 | 4.38 / 5.41 |
519
+ | sites | 15.30 / 16.50 | 6.89 / 7.15 | 6.54 / 9.47 | 5.74 / 9.47 | 5.74 / 9.47 | 4.06 / 5.17 |
520
+ | receipts | 16.30 / 15.69 | 5.86 / 6.41 | 16.30 / 15.69 | 16.30 / 15.69 | 16.30 / 15.69 | 3.65 / 4.01 |
521
+
522
+ `shell` is stored and validated; the shell templates are their own work.
523
+
437
524
  ### How the theme is chosen
438
525
 
439
526
  Every colour is one declaration holding both values, `light-dark(<light>, <dark>)`,
@@ -513,9 +600,75 @@ Import order matters — Tailwind first, then tokens, then the bridge:
513
600
  @import "@brignano/design/tailwind.css";
514
601
  ```
515
602
 
603
+ To use the components in a Tailwind site, import **`controls.css`**, not
604
+ `components.css`, and put the design layer below Tailwind's utilities:
605
+
606
+ ```css
607
+ @layer theme, base, brignano.components, components, utilities;
608
+ @import "tailwindcss";
609
+ @import "@brignano/design/tokens.css";
610
+ @import "@brignano/design/tailwind.css";
611
+ @import "@brignano/design/controls.css";
612
+ ```
613
+
614
+ - `controls.css` is `components.css` without the layout primitives
615
+ (`.container`, `.stack`, `.cluster`, `.grid`, `.section`, `.divider`,
616
+ `.gap-2` … `.gap-6`). Those names are Tailwind utilities too: with
617
+ `components.css`, every `grid` gets auto-fit columns and every `gap-4` moves
618
+ to the `--s` scale. Tailwind keeps the layout; design brings the controls.
619
+ It is generated by `npm run controls` and checked, never edited by hand.
620
+ - The `@layer` line comes first so `brignano.components` sits under
621
+ `utilities`. Without it the layer is declared after Tailwind's and beats
622
+ every utility, so `mt-4` on a `.btn` would lose.
623
+ - `.prose` is a component here and a class of `@tailwindcss/typography`.
624
+ A site that keeps the plugin renames its class (`@plugin
625
+ "@tailwindcss/typography" { className: "tw-prose"; }`) or moves to `.prose`.
626
+
516
627
  ## 12. The one rule that keeps this true
517
628
 
518
- **Never hardcode a hex outside `tokens.css`.**
629
+ **Never hardcode a hex outside the token files.**
630
+
631
+ ### Where a token lives
632
+
633
+ `tokens/*.json` is the source, one file per family (`color`, `type`, `space`,
634
+ `shape`, `motion`, `component`, `chart`), in the W3C design-tokens shape so
635
+ other tools can read it. `npm run build` writes `tokens.css`,
636
+ `tokens.chart.css`, `tailwind.css` and `tokens/names.d.ts` from it, and
637
+ `npm run check` fails if any of them is stale. Never edit a generated file.
638
+ The rules that aren't tokens (`color-scheme`, `::selection`, print, reduced
639
+ motion) are `tokens/head.css` and `tokens/base.css`.
640
+
641
+ Three tiers, and a rule for which one to read:
642
+
643
+ | Tier | Example | Read it from |
644
+ |---|---|---|
645
+ | **Primitive** | `--neutral-300` | other tokens only |
646
+ | **Semantic** | `--ink`, `--line`, `--action`, `--success-surface` | anything |
647
+ | **Component** | `--button-radius`, `--card-line`, `--focus-ring` | that component |
648
+
649
+ A component token starts as an alias of a semantic one. It exists so a kit or
650
+ a product's theme can restyle a component without touching a colour (ADR-0019).
651
+ `.card` reads `--card-line`, `--card-shadow` and `--card-radius`; the rest
652
+ wait on #183, which moves the other components onto them, so setting one of
653
+ those today changes nothing.
654
+
655
+ **Names that changed in 0.14.** The old name still resolves until 1.0;
656
+ `DeprecatedTokenName` in `tokens/names.d.ts` lists them.
657
+
658
+ | Before | Now |
659
+ |---|---|
660
+ | `--n-0` … `--n-900` | `--neutral-0` … `--neutral-900` |
661
+ | `--i`, `--i-hover`, `--i-pressed` | `--action`, `--action-hover`, `--action-pressed` |
662
+ | `--i-ink`, `--i-ink-hover` | `--action-ink`, `--action-ink-hover` |
663
+ | `--i-surface`, `--i-line`, `--i-selection` | `--action-surface`, `--action-line`, `--action-selection` |
664
+ | `--on-i` | `--on-action` |
665
+ | `--i-disabled-bg`, `--i-disabled-ink` | `--disabled`, `--disabled-ink` |
666
+ | `--s1` … `--s9` | `--space-1` … `--space-9` |
667
+ | `--dur-fast`, `--dur`, `--dur-slow` | `--duration-fast`, `--duration`, `--duration-slow` |
668
+ | `--radius` | `--radius-card` |
669
+
670
+ Reading an old name works. **Setting** one no longer reaches the components,
671
+ which read the new names: set the new name instead.
519
672
 
520
673
  Hardcoded values silently survive a theme change. `life`'s status pills carried
521
674
  literal greys for months and would have stayed light grey in dark mode.
@@ -644,7 +797,7 @@ The attributes `product-page.css` gives every page:
644
797
  **stage** (a faint field behind the hero proof), the clip's current step and
645
798
  the how-it-works numerals, and it **fills the one primary button**
646
799
  (`--mark-fill` under `--on-mark`, §3). It is never a link, text or state,
647
- and the focus ring stays `--i-ink`.
800
+ and the focus ring stays `--action-ink`.
648
801
  - **An ink button** (`data-button="ink"` on `.pp`) when the mark is better
649
802
  kept for the picture. A page with no `data-mark` is ink too.
650
803
  - **A mark ground** (`data-ground="mark"` on `.pp`): the page washes in
@@ -816,6 +969,9 @@ and in what order: [`proposals/component-layer.md`](./proposals/component-layer.
816
969
  @import '@brignano/design/components.css';
817
970
  ```
818
971
 
972
+ A Tailwind site imports `controls.css` instead: the same components without
973
+ the layout primitives whose names Tailwind already uses (§11).
974
+
819
975
  - **One layer.** Everything is inside `@layer brignano.components`. A consumer's
820
976
  unlayered CSS and Tailwind utilities beat it without `!important`, so a site
821
977
  can adjust a component without fighting it.
package/README.md CHANGED
@@ -7,9 +7,11 @@ The shared design system for every brignano surface — `brignano.io`, `life`,
7
7
  |---|---|
8
8
  | [`DESIGN.md`](./DESIGN.md) | **Start here.** The rules — the three colour layers, the two tiers, type, motion. |
9
9
  | [`decisions/`](./decisions/README.md) | Why the values are what they are. One ADR per file. |
10
- | [`tokens.css`](./tokens.css) | Single source of truth for colour, type, space, shape, motion. |
10
+ | [`tokens/`](./tokens) | The source: every token as JSON, by family. Edit here, then `npm run build`. |
11
+ | [`tokens.css`](./tokens.css) | Generated from `tokens/`. What a surface imports for colour, type, space, shape, motion. |
11
12
  | [`tokens.chart.css`](./tokens.chart.css) | Validated categorical palette for data viz. |
12
13
  | [`components.css`](./components.css) | Shared controls and patterns as plain CSS in `@layer brignano.components`: one import, any framework. DESIGN.md §14; catalog in `proposals/component-layer.md`; preview in `previews/components.html`. |
14
+ | [`controls.css`](./controls.css) | `components.css` without the layout primitives (`.container`, `.stack`, `.cluster`, `.grid`, `.section`, `.divider`, `.gap-*`), for a Tailwind site where those names are already utilities. Generated by `npm run controls`; DESIGN.md §11. |
13
15
  | [`product-page.css`](./product-page.css) | The structure of a product's marketing page, built from a five-line brief: thesis and proof on the first phone screen, one signature band, how it works, closing ask. The shared parts every page needs, and a starting point for the look each product writes over it: its mark fills the primary button, and five choices keep any two products from looking alike (ADR-0017). DESIGN.md §13; skeleton in `previews/product-page.html`, one worked example per product in `previews/product-page-example.html` (Driftwood), `product-page-guidebook.html` and `product-page-sites.html`, first-screen check in `scripts/fold.mjs`. |
14
16
  | [`templates/`](./templates) | Page templates built on `components.css`: `article.css` (posts and docs), `changelog.css`, `legal.css`, `error.css` (404, 500, offline), `settings.css`, and a transactional email (`email.html` + `email.txt`, filled from the tokens by `scripts/email-tokens.mjs`). Import as `@brignano/design/templates/<name>.css`. |
15
17
  | [`icons/`](./icons) | One curated outline icon set (Lucide, ISC; `icons/LICENSE`) on a 24px grid in `currentColor`. Size with `.icon-sm`, `.icon`, `.icon-lg` from `components.css`; browse and copy in `previews/icons.html`. Paste the markup inline (`@brignano/design/icons/<name>.svg`); through `<img>` an icon can't take the text colour. |
@@ -21,7 +23,7 @@ The shared design system for every brignano surface — `brignano.io`, `life`,
21
23
  Three layers, so no colour does two jobs:
22
24
 
23
25
  - **`--mark`** — identity. Larch amber. Inks a product's glyph, the monogram and a hero rule. Never a control.
24
- - **`--i-*`** — affordance. Cobalt. Links, buttons, focus, selection. Semantically inert.
26
+ - **`--action-*`** — affordance. Cobalt. Links, buttons, focus, selection. Semantically inert.
25
27
  - **`--success / --attention / --danger`** — state. Conventional hues, always with an icon and a word.
26
28
 
27
29
  Distinctiveness lives in the mark; conventionality lives in the control layer.
@@ -43,6 +45,52 @@ Light and dark follow the OS until something sets `data-theme="light"` or
43
45
  part (DESIGN.md §11). Each colour is a single `light-dark()` declaration, so this
44
46
  needs a browser from mid-2024 or later.
45
47
 
48
+ ### Kits
49
+
50
+ Three looks ship beside the default one, opt-in until 1.0 (ADR-0020). Import
51
+ one and name it on `<html>`, or on any element to give just that part the look:
52
+
53
+ ```css
54
+ @import '@brignano/design/kits/split.css'; /* or ledger.css, larch.css */
55
+ ```
56
+
57
+ ```html
58
+ <html data-kit="split">
59
+ ```
60
+
61
+ A kit names its typefaces; the surface loads them. All are SIL OFL, latin
62
+ subset, in [`fonts/`](./fonts) with their licences:
63
+
64
+ | Kit | Load | Size |
65
+ |---|---|---|
66
+ | `split` | `archivo-latin-wdth-normal.woff2`, `martian-mono-latin-wght-normal.woff2` | 111 KB |
67
+ | `ledger` | `newsreader-latin-wght-normal.woff2`, `newsreader-latin-wght-italic.woff2`, `instrument-sans-latin-wght-normal.woff2`, and Plex Mono | 149 KB + 44 KB |
68
+ | `larch` | `bricolage-grotesque-latin-wght-normal.woff2`, `onest-latin-wght-normal.woff2`, and Plex Mono | 73 KB + 44 KB |
69
+
70
+ Plex Mono is `ibm-plex-mono-latin-400-normal.woff2`, `-500-` and `-600-` (44 KB
71
+ together), which a surface on today's look already loads.
72
+
73
+ The `@font-face` rules are in [`previews/_fonts.css`](./previews/_fonts.css) to
74
+ copy. Components are not restyled for the kits yet.
75
+
76
+ ### Product themes
77
+
78
+ A product's look is a few lines in [`themes/`](./themes) (a kit, a ground, a
79
+ hue, a face, corners), built into one CSS file. Import it and name the product;
80
+ there is no kit file to import as well:
81
+
82
+ ```css
83
+ @import '@brignano/design/themes/sites.css';
84
+ ```
85
+
86
+ ```html
87
+ <html data-product="sites">
88
+ ```
89
+
90
+ Shipped: `homelab`, `driftwood`, `guidebook`, `sites`, `receipts`. Adding one
91
+ is a new `.theme` file and `npm run build` (DESIGN.md §11, "Product themes").
92
+ Load the fonts of the theme's kit, plus any face its `typeface` names.
93
+
46
94
  The tool tier is the default. A marketing surface opts in with
47
95
  `class="tier-marketing"` on `<html>`, which unlocks the display face and opens the
48
96
  type scale. Colour is identical across tiers.
@@ -75,7 +123,7 @@ preview renders unstyled.
75
123
  ## For agents
76
124
 
77
125
  Read `DESIGN.md` before styling anything. Use the tokens. **Never hardcode a hex
78
- outside `tokens.css`** — a literal survives a theme change silently, which is how
126
+ outside `tokens/`** — a literal survives a theme change silently, which is how
79
127
  `life`'s status pills sat light grey in dark mode for months.
80
128
 
81
129
  ## Status