@brignano/design 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DECISIONS.md +176 -0
- package/DESIGN.md +250 -75
- package/README.md +4 -1
- package/components.css +2134 -0
- package/package.json +11 -3
- package/product-page.css +184 -20
- package/scripts/colour.mjs +41 -0
- package/scripts/email-tokens.mjs +58 -0
- package/scripts/fold.mjs +135 -0
- package/tailwind.css +7 -0
- package/templates/article.css +167 -0
- package/templates/changelog.css +53 -0
- package/templates/email.html +61 -0
- package/templates/email.txt +10 -0
- package/templates/legal.css +65 -0
- package/tokens.css +30 -0
package/DECISIONS.md
CHANGED
|
@@ -410,3 +410,179 @@ Decorative motion stays out.
|
|
|
410
410
|
the page reads the same with the script off.
|
|
411
411
|
- Any later animation in a tool has to meet the same four conditions or it is
|
|
412
412
|
decorative.
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
## ADR-0010 — Product pages show, then tell
|
|
417
|
+
|
|
418
|
+
**Status:** accepted · 2026-11-01
|
|
419
|
+
|
|
420
|
+
### Context
|
|
421
|
+
|
|
422
|
+
The first product page built on §13 (driftwood.brignano.io) was shown on a
|
|
423
|
+
phone to a technical reader outside its field. They scrolled once and handed
|
|
424
|
+
the phone back. Rendered at iPhone size, the first screen was a 10-word thesis
|
|
425
|
+
over four lines and a 47-word subhead, with no picture; the proof started a
|
|
426
|
+
screen and a half down and was cropped; the page ran to almost nine screens,
|
|
427
|
+
most of it four prose chapters (problem, how it works, who it's for, why now).
|
|
428
|
+
The template asked for exactly that: copy before proof on a phone, and a story
|
|
429
|
+
of chapters, which reads as a case study.
|
|
430
|
+
|
|
431
|
+
### Decision
|
|
432
|
+
|
|
433
|
+
A product page shows, then tells. The hero splits into head (status, a thesis
|
|
434
|
+
of 8 words or fewer naming the outcome), proof, and body (one sentence, the
|
|
435
|
+
actions), and stacks in that order on a phone, so the proof is on the first
|
|
436
|
+
screen. The story chapters give way to two short bands: three "what you get"
|
|
437
|
+
cards that each lead with a picture, and three one-line steps. At most one
|
|
438
|
+
chapter stays; the longer argument moves to the docs. `scripts/fold.mjs`
|
|
439
|
+
checks the first phone screen and the page length in CI.
|
|
440
|
+
|
|
441
|
+
### Consequences
|
|
442
|
+
|
|
443
|
+
- The older hero markup still lays out, so existing sites keep working until
|
|
444
|
+
they move to the split; `fold.mjs` fails them until they do.
|
|
445
|
+
- The pictures carry the colour (state hues with their words, §3); the page
|
|
446
|
+
around them stays restrained.
|
|
447
|
+
- driftwood, guidebook and sites each rewrite their copy to the new limits in
|
|
448
|
+
their own repos.
|
|
449
|
+
- A cold read of the first example still left a stranger asking who it was
|
|
450
|
+
for, whether they could try it, and what "Request access" leads to. So the
|
|
451
|
+
hero also carries an audience line (checked), the secondary action is a
|
|
452
|
+
live demo when one exists, the note says what happens next, and unbacked
|
|
453
|
+
claims are cut. Forced scroll animation was considered and rejected: it
|
|
454
|
+
slows phones and loses skimmers; a hero clip carries the motion instead.
|
|
455
|
+
|
|
456
|
+
---
|
|
457
|
+
|
|
458
|
+
## ADR-0011 — Product pages start from a brief, and each looks like itself
|
|
459
|
+
|
|
460
|
+
**Status:** accepted · 2026-11-02
|
|
461
|
+
|
|
462
|
+
### Context
|
|
463
|
+
|
|
464
|
+
ADR-0010 fixed the layout, and every product page still needed several rounds
|
|
465
|
+
of "explain it to a stranger" review. Driftwood, Guidebook and Sites were
|
|
466
|
+
each rebuilt on §13, then reworked again in their own repos: pain-first
|
|
467
|
+
subheads, captions inside the clip, plain words in the mock, the person
|
|
468
|
+
behind it, a plain price. Three causes:
|
|
469
|
+
|
|
470
|
+
- Nothing fixed the **message** before the page. The words came from the
|
|
471
|
+
repo, README and spec, so they described how the product works; each
|
|
472
|
+
review was a positioning debate held through page edits.
|
|
473
|
+
- Each review **added a required element** (an audience line, a "what happens
|
|
474
|
+
next" note, the status in two places), so the first screen grew to ~100
|
|
475
|
+
words while passing every check. `fold.mjs` counted the thesis and subhead
|
|
476
|
+
but not the page.
|
|
477
|
+
- The only clarity test, "hand it to someone outside the field", was a
|
|
478
|
+
manual checkbox, so it didn't run.
|
|
479
|
+
|
|
480
|
+
Put side by side, the three pages were also the same page: one grey ground,
|
|
481
|
+
one cobalt audience line, one black thesis, one status pill twice, one proof
|
|
482
|
+
on the right, one band order. Only the picture changed, so nobody looking
|
|
483
|
+
across the projects could tell them apart.
|
|
484
|
+
|
|
485
|
+
### Decision
|
|
486
|
+
|
|
487
|
+
- **Brief first.** Five lines (Who, Pain, Promise, Moment, Ask) in
|
|
488
|
+
`BRIEF.md`, approved before any page; the page is built from it.
|
|
489
|
+
- **Budgets, checked.** 40 words of copy on the first phone screen, 180 on the
|
|
490
|
+
page, the status once. `fold.mjs` fails a page over them.
|
|
491
|
+
- **The stranger test is a step, not a checkbox.** The first-screen shot goes
|
|
492
|
+
to a person or a context-free agent with a fixed prompt; the answers go in
|
|
493
|
+
the PR and must match the brief.
|
|
494
|
+
- **Each product looks like itself.** A product mark (`--mark-teal`,
|
|
495
|
+
`--mark-violet`, `--mark-magenta`) chosen with `data-mark`, a hero layout
|
|
496
|
+
(`split`, `mirror`, `stage`) and a proof frame (bare, phone, browser). No two
|
|
497
|
+
products share all three. Each page also picks its own signature band
|
|
498
|
+
(cards, a comparison, or something of its own) instead of always having
|
|
499
|
+
three cards.
|
|
500
|
+
- Learned in the product repos and now in the template: the subhead is the Pain
|
|
501
|
+
then the fix; clips carry captions; the mock speaks plain words; the
|
|
502
|
+
audience line is ink, not cobalt.
|
|
503
|
+
|
|
504
|
+
### Consequences
|
|
505
|
+
|
|
506
|
+
- A product mark is the one place a hue appears as a wash: the stage behind
|
|
507
|
+
the hero proof, at 8%. That is a scoped exception to "identity is not a
|
|
508
|
+
fill" (§3). It is safe because the product hues mean nothing else in the
|
|
509
|
+
system, and the stage never sits behind a control or a state.
|
|
510
|
+
- Actions stay cobalt on every product, so "you can click this" still means
|
|
511
|
+
one thing everywhere.
|
|
512
|
+
- §13 is shorter: the rules that drive clarity stay, and the ones that only
|
|
513
|
+
added words are gone.
|
|
514
|
+
- Driftwood, Guidebook and Sites each add a `BRIEF.md`, pick their identity
|
|
515
|
+
and cut to the budgets in their own repos.
|
|
516
|
+
|
|
517
|
+
---
|
|
518
|
+
|
|
519
|
+
## ADR-0012 — Shared components ship as plain CSS in a cascade layer
|
|
520
|
+
|
|
521
|
+
**Status:** accepted · 2026-11-07 · proposal `proposals/component-layer.md` (#45, #85)
|
|
522
|
+
|
|
523
|
+
### Context
|
|
524
|
+
|
|
525
|
+
The package shipped tokens and the product-page template. Buttons, fields,
|
|
526
|
+
messages and pills existed only on the preview pages, so every consumer rebuilt
|
|
527
|
+
them, and they drifted (brignano.io: about five button styles, an `opacity-40`
|
|
528
|
+
disabled state that §4 forbids).
|
|
529
|
+
|
|
530
|
+
### Decision
|
|
531
|
+
|
|
532
|
+
- Components ship as **plain CSS classes**: `components.css` for controls and
|
|
533
|
+
patterns, `templates/<name>.css` per page template. No React wrappers, no JS.
|
|
534
|
+
- Short unprefixed names (`.btn`, `.field`) inside `@layer brignano.components`,
|
|
535
|
+
so a consumer's own CSS and utilities win without `!important`. States come
|
|
536
|
+
from real attributes (`disabled`, `aria-invalid`, `[open]`), never classes.
|
|
537
|
+
- **Native first:** `<dialog>`, `popover`, `<details>`, anchor positioning.
|
|
538
|
+
Where behaviour needs JS, design documents the ARIA contract and the consumer
|
|
539
|
+
owns the script.
|
|
540
|
+
- `.pp-button` / `.pp-field` become aliases of the shared classes until 1.0.
|
|
541
|
+
- The full catalog is decided now in three waves; wave 3 is built only when a
|
|
542
|
+
product needs it.
|
|
543
|
+
|
|
544
|
+
### Consequences
|
|
545
|
+
|
|
546
|
+
- One import gives any surface, React or not, the same controls.
|
|
547
|
+
- Every class must appear on a docs page, and contrast is checked in both
|
|
548
|
+
themes (`npm run check`).
|
|
549
|
+
- Behaviour bugs live in consumers' JS, not here; the docs pages carry the
|
|
550
|
+
contract so they are written the same way.
|
|
551
|
+
|
|
552
|
+
---
|
|
553
|
+
|
|
554
|
+
## ADR-0013 — Overlays may move as they open and close
|
|
555
|
+
|
|
556
|
+
**Status:** accepted · 2026-11-09 · #116, from #55
|
|
557
|
+
|
|
558
|
+
### Context
|
|
559
|
+
|
|
560
|
+
The tool tier has no motion (§2), and §7 rules out entrance animation.
|
|
561
|
+
ADR-0009 allowed one exception: motion the reader starts that shows an order.
|
|
562
|
+
The component catalog (#55 dialog, #56 popover and menu, #58 toast) asked for
|
|
563
|
+
open and close motion on overlays, which meets none of ADR-0009's conditions.
|
|
564
|
+
Dialogs and sheets first shipped still (#115). A sheet that appears from
|
|
565
|
+
nowhere doesn't say which edge it belongs to, and a dialog that blinks in
|
|
566
|
+
reads as a page jump. Anthony chose to allow the motion with its own entry.
|
|
567
|
+
|
|
568
|
+
### Decision
|
|
569
|
+
|
|
570
|
+
An overlay (dialog, sheet, popover or menu, toast) may animate as it opens
|
|
571
|
+
and closes, in both tiers, when:
|
|
572
|
+
|
|
573
|
+
- the person opened it, or it answers something they just did;
|
|
574
|
+
- only `opacity` and `transform` move, for `--dur-fast` on `--ease`: a fade
|
|
575
|
+
plus a slide of a few pixels, or a sheet sliding from its own edge;
|
|
576
|
+
- the open state is fully shown without the animation (it comes from
|
|
577
|
+
`@starting-style`), so a browser that lacks it shows the overlay at once;
|
|
578
|
+
- `prefers-reduced-motion` makes it instant, `::backdrop` included.
|
|
579
|
+
|
|
580
|
+
### Consequences
|
|
581
|
+
|
|
582
|
+
- §2's motion row and §7 name this as the one exception beside ADR-0009.
|
|
583
|
+
Content on the page itself still never animates in.
|
|
584
|
+
- `.dialog` and `.sheet` get the motion now. Popover, menu and toast use the
|
|
585
|
+
same timing when they are built. The site header's phone menu (#54) can
|
|
586
|
+
adopt it in a later change.
|
|
587
|
+
- Anything else that wants to move still has to meet ADR-0009 or it is
|
|
588
|
+
decorative.
|
package/DESIGN.md
CHANGED
|
@@ -31,7 +31,7 @@ family, motion and shape are identical; what changes is how much room things get
|
|
|
31
31
|
| Section rhythm | `--s9` (96px) | `--s6` (32px) |
|
|
32
32
|
| Measure | 68ch | 780px |
|
|
33
33
|
| Display face | Silkscreen — monogram, hero eyebrows | none (aliases to `--sans`) |
|
|
34
|
-
| Motion | the trail, scroll reveal | none |
|
|
34
|
+
| Motion | the trail, scroll reveal, overlays opening and closing (ADR-0013) | none, except overlays opening and closing (ADR-0013) |
|
|
35
35
|
| Density | whitespace carries the layout | scanning beats reading |
|
|
36
36
|
|
|
37
37
|
## 3. Colour — one hue, one meaning
|
|
@@ -90,6 +90,15 @@ Every state ships with an **icon and a word**. Colour is the accelerant, not the
|
|
|
90
90
|
signal — this covers colour-vision deficiency, greyscale printing, and forced-colours
|
|
91
91
|
mode in one rule.
|
|
92
92
|
|
|
93
|
+
### Code is the one non-interactive cobalt
|
|
94
|
+
|
|
95
|
+
Syntax keywords (`--code-keyword`) and a highlighted line (`--code-highlight`)
|
|
96
|
+
borrow the cobalt ink and wash, though nothing there can be acted on. It's
|
|
97
|
+
deliberate and contained: inside a code block, a reader scanning for structure
|
|
98
|
+
needs one accent, and cobalt is the only hue that can't be misread as a state.
|
|
99
|
+
Everything else in code is neutral (§9). Nowhere outside a code block does
|
|
100
|
+
cobalt mean anything but *you can act on this*.
|
|
101
|
+
|
|
93
102
|
### What does NOT get colour
|
|
94
103
|
|
|
95
104
|
Event type. Six types in six colours is exactly the complication this avoids —
|
|
@@ -102,14 +111,21 @@ The part that makes an interface feel built rather than styled.
|
|
|
102
111
|
|
|
103
112
|
- `--i` fill, `--i-hover`, `--i-pressed`, `--i-ink` for links/icons/focus.
|
|
104
113
|
- **Disabled is neutral, never hued** (`--i-disabled-bg` / `--i-disabled-ink`). A
|
|
105
|
-
greyed-out control must stop signalling "click me".
|
|
114
|
+
greyed-out control must stop signalling "click me". Its low contrast is allowed
|
|
115
|
+
only because WCAG 1.4.3 exempts *inactive* controls, so the state must be real:
|
|
116
|
+
`disabled` on a button or input, `aria-disabled="true"` otherwise. Disabled
|
|
117
|
+
styling on an element that isn't marked disabled is just low-contrast text.
|
|
106
118
|
- Focus is always visible: 2px `--i-ink` outline, 2px offset. Never remove it.
|
|
107
119
|
- Hover and pressed surfaces on neutral elements come from `--surface-hover` and
|
|
108
120
|
`--surface-active`, not from opacity tricks.
|
|
109
121
|
- A control's own edge — an input, a secondary button — is `--line-control`
|
|
110
122
|
(≥ 3:1). `--line-strong` is a divider, too faint to tell you a control is there.
|
|
111
|
-
-
|
|
112
|
-
`
|
|
123
|
+
- Checkboxes and radios in a `.choice` row are drawn from tokens
|
|
124
|
+
(`components.css`), so they look the same on every OS. Bare ones, ranges and
|
|
125
|
+
progress bars stay native and inherit `accent-color: var(--i)` from
|
|
126
|
+
`tokens.css`; don't restyle those just to recolour them. `.progress` and
|
|
127
|
+
`.meter` on a native `<progress>` or `<meter>` draw it from tokens, for
|
|
128
|
+
when a bar must look the same everywhere.
|
|
113
129
|
|
|
114
130
|
## 5. Type
|
|
115
131
|
|
|
@@ -154,13 +170,23 @@ or is disabled is disqualified.
|
|
|
154
170
|
and that block ships inside `tokens.css` so no surface can forget it. One easing
|
|
155
171
|
curve (`--ease`), three durations, compositor-only properties.
|
|
156
172
|
|
|
157
|
-
**The tool tier has
|
|
173
|
+
**The tool tier has two exceptions. The first is motion a person asks for.** A control that
|
|
158
174
|
walks through a sequence step by step, such as driftwood's *Trace a request*,
|
|
159
175
|
may animate, because the reader started it to follow an order of events, and
|
|
160
176
|
the order is the content. It runs only when clicked, never on load; it can be
|
|
161
177
|
stopped at any step; every state it passes through is also listed as text; and
|
|
162
178
|
under `prefers-reduced-motion` it shows the final state (the whole sequence lit)
|
|
163
|
-
at once. Nothing decorative qualifies: no entrance, hover or scroll animation
|
|
179
|
+
at once. Nothing decorative qualifies: no entrance, hover or scroll animation,
|
|
180
|
+
except the overlay case below.
|
|
181
|
+
|
|
182
|
+
**The second: overlays may move as they open and close, in both tiers**
|
|
183
|
+
(ADR-0013). A dialog, sheet, popover, menu or toast that someone opened, or that answers what they
|
|
184
|
+
just did, fades and slides a few pixels (a sheet from its own edge) over
|
|
185
|
+
`--dur-fast`. Only opacity and transform move; the open state is always fully
|
|
186
|
+
shown, so a browser without `@starting-style` shows it at once; and under
|
|
187
|
+
`prefers-reduced-motion` it is instant, backdrop included. An overlay that is
|
|
188
|
+
already open when the page loads doesn't animate. That is the whole
|
|
189
|
+
exception: content on the page itself still never animates in.
|
|
164
190
|
|
|
165
191
|
## 8. Charts
|
|
166
192
|
|
|
@@ -202,6 +228,10 @@ is thirty coloured things, and the one that is down disappears among them.
|
|
|
202
228
|
The diff tokens alias the state hues on purpose (added is *settled*, a change is
|
|
203
229
|
*informational*, a removal is the change that can lose data), so a diff adds no
|
|
204
230
|
hue to the system. Health wins the fill (`-surface`); a diff only takes the edge.
|
|
231
|
+
- **Code is neutral too.** `--code-keyword` is the cobalt ink; strings are
|
|
232
|
+
`--code-string` (`--ink-soft`), comments `--code-comment` (`--slate`, italic),
|
|
233
|
+
everything else `--code-ink`. A highlighted line is `--code-highlight`. No
|
|
234
|
+
syntax rainbow: a reader scanning code needs the keywords, not a palette.
|
|
205
235
|
- **Selection** is the focus treatment: a 2px `--i-ink` outline, offset. Asking
|
|
206
236
|
"what depends on this?" dims everything unrelated to ~30% opacity and inks the
|
|
207
237
|
connecting edges in `--ink`; it never introduces a colour.
|
|
@@ -321,71 +351,153 @@ which is why changing the accent was a migration rather than a one-line edit.
|
|
|
321
351
|
|
|
322
352
|
## 13. Product pages
|
|
323
353
|
|
|
324
|
-
A product's marketing page
|
|
325
|
-
|
|
326
|
-
|
|
354
|
+
A product's marketing page has about five seconds on a phone to land, with
|
|
355
|
+
someone who has never heard of it: a buyer, a stranger at a meetup, your mum.
|
|
356
|
+
**Show, then tell**: the first phone screen says who it's for, shows the
|
|
357
|
+
product doing the thing, and offers one thing to do, without a paragraph.
|
|
358
|
+
The longer argument belongs in the docs.
|
|
359
|
+
|
|
360
|
+
Pages built from layout rules alone kept failing the same way (ADR-0011): the
|
|
361
|
+
words came from the repo, so they described how the product works instead of
|
|
362
|
+
why anyone should want it, and each review added another required line. So
|
|
363
|
+
the order of work is fixed: **brief, page, checks, stranger test.**
|
|
364
|
+
|
|
365
|
+
### 1. Write the brief first
|
|
366
|
+
|
|
367
|
+
Five lines, in the words a stranger would use, kept as `BRIEF.md` in the
|
|
368
|
+
product's repo and approved before any page work. Every word on the page comes
|
|
369
|
+
from it; a change of message is a change to the brief, then the page.
|
|
370
|
+
|
|
371
|
+
| Line | Answers | Becomes |
|
|
372
|
+
|---|---|---|
|
|
373
|
+
| **Who** | who it's for, as they'd say it | `.pp-audience` |
|
|
374
|
+
| **Pain** | what goes wrong for them today | the first half of `.pp-subhead` |
|
|
375
|
+
| **Promise** | what they get, 8 words or fewer | `.pp-thesis` |
|
|
376
|
+
| **Moment** | the 10 seconds that prove it | the proof (`.pp-media`) |
|
|
377
|
+
| **Ask** | the one action, and what happens next | `.pp-button`, `.pp-note` |
|
|
378
|
+
|
|
379
|
+
No jargon in Who, Pain or Promise. Tool names (Terraform, CI, AWS) go in the
|
|
380
|
+
how-it-works steps. If a person outside the field can't repeat the Promise
|
|
381
|
+
back, rewrite the brief, not the page.
|
|
382
|
+
|
|
383
|
+
### 2. Build the page from it
|
|
384
|
+
|
|
385
|
+
`product-page.css` is the structure; `previews/product-page.html` is the
|
|
386
|
+
skeleton (the brief template is at its top) and
|
|
387
|
+
`previews/product-page-example.html` is a worked example. Import it after the
|
|
388
|
+
tokens, put `tier-marketing` on `<html>` and `pp` on `<body>`.
|
|
327
389
|
|
|
328
390
|
```css
|
|
329
391
|
@import '@brignano/design/tokens.css';
|
|
330
392
|
@import '@brignano/design/product-page.css';
|
|
331
393
|
```
|
|
332
394
|
|
|
333
|
-
The
|
|
334
|
-
|
|
335
|
-
1. **Header** (`.pp-header`)
|
|
336
|
-
|
|
337
|
-
2. **Hero** (`.pp-hero`)
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
the
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
395
|
+
The bands, in order:
|
|
396
|
+
|
|
397
|
+
1. **Header** (`.pp-header`): brand, two or three in-page links, the primary
|
|
398
|
+
action. The status is not repeated here.
|
|
399
|
+
2. **Hero** (`.pp-hero`), three parts: `.pp-hero-head` (the status, the
|
|
400
|
+
audience line, the thesis), the **proof** (`.pp-media`), then
|
|
401
|
+
`.pp-hero-body` (the subhead, the primary action and one secondary, and a
|
|
402
|
+
note). On a phone they stack in that order, so the proof is on the first
|
|
403
|
+
screen.
|
|
404
|
+
- The **subhead** is one sentence, the Pain then the fix: "When your app
|
|
405
|
+
goes down, Driftwood shows the broken piece, why, and what the last
|
|
406
|
+
deploy changed."
|
|
407
|
+
- The **proof** is the Moment: the product doing the thing, ideally
|
|
408
|
+
mid-story. In order of preference: a short captioned clip (*Video in the
|
|
409
|
+
proof slot*, below), a live demo, a real screenshot, a faithful mock from
|
|
410
|
+
the product's own components. Never stock imagery. Words inside the proof
|
|
411
|
+
are the product's own, in plain language ("Your shop is down"), not log
|
|
412
|
+
lines.
|
|
413
|
+
- **Demo first.** If anything can be tried without signing up, the
|
|
414
|
+
secondary action is "Try the live demo" and opens it directly.
|
|
415
|
+
- The **note** says what happens after the click, in about ten words
|
|
416
|
+
("Demo needs no signup. We reply within two days.").
|
|
417
|
+
3. **The signature band**: one band only this product could have. Three
|
|
418
|
+
"you get" cards (`ul.pp-gets`, each a picture, a heading, one line); the
|
|
419
|
+
product beside the obvious alternative (`.pp-compare`, below); or a band of
|
|
420
|
+
its own, such as a library of ready-made guides or the live demo itself.
|
|
421
|
+
Pick the one that answers the stranger's next question for *this* product.
|
|
422
|
+
4. **How it works** (`ol.pp-how`): three numbered steps, a heading and one
|
|
423
|
+
line each.
|
|
424
|
+
5. **Close** (`.pp-close`): the primary action again, with the room a form
|
|
425
|
+
needs (`.pp-panel`), and prices if any.
|
|
426
|
+
6. **Footer** (`.pp-footer`): the brand and its promise, a few links, then the
|
|
427
|
+
legal line (`.pp-legal`): `© {year} Anthony Brignano. All rights
|
|
428
|
+
reserved.` and the product's Privacy and Terms links if it has them.
|
|
429
|
+
|
|
430
|
+
**Budgets** (`fold.mjs` enforces them): the thesis 8 words or fewer; the
|
|
431
|
+
subhead one sentence of 25 or fewer; **40 words of copy on the first phone
|
|
432
|
+
screen; 180 on the whole page**; 7 phone screens. Copy is what the reader has
|
|
433
|
+
to read: words inside pictures, the form, the header and footer don't count.
|
|
434
|
+
When a page is over, cut sentences, don't shrink type.
|
|
435
|
+
|
|
436
|
+
### 3. Make it look like this product
|
|
437
|
+
|
|
438
|
+
Shared structure is what makes a page fast to build; shared looks is what made
|
|
439
|
+
Driftwood, Guidebook and Sites read as one page with the words swapped. Each
|
|
440
|
+
product makes three choices, and **no two products make all three the same**:
|
|
441
|
+
|
|
442
|
+
- **A mark** (`data-mark` on `.pp`: `teal`, `violet` or `magenta`; tokens
|
|
443
|
+
`--mark-teal` and so on). It inks the product's glyph (an inline SVG in
|
|
444
|
+
`currentColor`), the hero rule above the thesis, the **stage** (a faint field
|
|
445
|
+
behind the hero proof), the clip's current step and the how-it-works
|
|
446
|
+
numerals. Like `--mark` (§3), it is never a button, link, text or state: the
|
|
447
|
+
actions stay cobalt on every product, so "you can click this" means the same
|
|
448
|
+
thing everywhere.
|
|
449
|
+
- **A hero layout** (`data-layout` on `.pp-hero`): `split` (the default, proof
|
|
450
|
+
on the right), `mirror` (proof on the left, for a picture that should be
|
|
451
|
+
read first) or `stage` (centred words and actions, the proof full width
|
|
452
|
+
under them, for a wide picture such as a map). Phones stack all three the same.
|
|
453
|
+
- **A frame for the proof** that matches where the product lives: bare, a
|
|
454
|
+
phone (`.pp-device`) for something used on a phone, or a browser window
|
|
455
|
+
(`.pp-browser`, with `.pp-browser-bar` and `.pp-browser-url`) for an
|
|
456
|
+
extension or web app.
|
|
457
|
+
|
|
458
|
+
Then the voice: the thesis, the signature band and the close are written for
|
|
459
|
+
this product's reader, not copied from the last page.
|
|
460
|
+
|
|
461
|
+
### Compare
|
|
462
|
+
|
|
463
|
+
`.pp-compare` holds two `<div>`s, each an `<h3>` and a `<ul>` of the same
|
|
464
|
+
three rows: the obvious alternative first, then ours with `.is-ours`, which
|
|
465
|
+
takes the mark on its top rule and stacks first on a phone. The rows are
|
|
466
|
+
words ("Pay monthly, forever" beside "Pay once"), never ticks and crosses
|
|
467
|
+
alone.
|
|
468
|
+
|
|
469
|
+
### Rules
|
|
368
470
|
|
|
369
471
|
- **One primary action per page.** `.pp-button` is that action, everywhere it
|
|
370
472
|
appears. Anything else is `.pp-button.is-secondary` or a link.
|
|
371
|
-
- **The status is a word with a dot** (`.pp-status`)
|
|
372
|
-
|
|
373
|
-
`"soon"` takes `--attention`;
|
|
374
|
-
|
|
375
|
-
- **
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
- **Restraint carries the style
|
|
388
|
-
type scale. No gradients, no tinted
|
|
473
|
+
- **The status is a word with a dot** (`.pp-status`), shown once in the hero
|
|
474
|
+
and again in the close: "Pilot open", "Private beta". `data-state="open"`
|
|
475
|
+
takes `--success`, `"soon"` takes `--attention`; the word carries the meaning
|
|
476
|
+
on its own (§3).
|
|
477
|
+
- **Every claim is backed or cut.** A time, a number or a superlative needs a
|
|
478
|
+
source the page can point to. Without one, drop it.
|
|
479
|
+
- **Prices sit beside the ask.** `dl.pp-price` holds two to four options, one
|
|
480
|
+
`<div>` each: the price as `<dt>`, one line of condition as `<dd>`, in the
|
|
481
|
+
close band under its subhead. A single price goes in the subhead. No option
|
|
482
|
+
gets its own button; no strike-through prices, badges or highlighted tiers.
|
|
483
|
+
- **Headlines are sentences.** Calm and declarative, no exclamation marks.
|
|
484
|
+
- **Scroll stays the reader's.** No scroll-jacking, pinned sections or
|
|
485
|
+
scroll-driven reveals. Motion lives in the hero clip (§7, ADR-0009).
|
|
486
|
+
- **Pictures over paragraphs.** Every band after the hero leads with a picture,
|
|
487
|
+
a list or a comparison, never prose. At most one story chapter
|
|
488
|
+
(`ol.pp-story`), and only when one point truly needs a paragraph.
|
|
489
|
+
- **Restraint carries the style; the product and its mark carry the colour.**
|
|
490
|
+
Hairlines between bands, whitespace, the type scale. No gradients, no tinted
|
|
491
|
+
bands. Colour lives in the proof (a red box with its word, a diff) and in
|
|
492
|
+
the product's mark.
|
|
493
|
+
- **Forms** (`.pp-form` of `.pp-field`, label above the control) mark the
|
|
494
|
+
optional fields, not the required ones. A field that fails takes
|
|
495
|
+
`aria-invalid="true"` and a `.pp-error` sentence; a failed send puts its
|
|
496
|
+
error in the note (`.pp-note.is-error`); on success the form gives way to
|
|
497
|
+
`.pp-done`, focused, with `role="status"`.
|
|
498
|
+
- **The year** in the legal line is filled in at build time (a template value,
|
|
499
|
+
a bundler `define`, or the Worker as it serves the page). Never typed, and
|
|
500
|
+
never written by client script.
|
|
389
501
|
|
|
390
502
|
### Video in the proof slot
|
|
391
503
|
|
|
@@ -397,6 +509,11 @@ or inside `.pp-device`, a phone frame. `previews/product-media.html` shows both.
|
|
|
397
509
|
- **The clip.** `<video muted loop playsinline preload="metadata">` with
|
|
398
510
|
`width`/`height` set, a `poster`, and no `autoplay` attribute. Keep it under
|
|
399
511
|
about 15 seconds and silent: it loops, and nobody turns sound on in a hero.
|
|
512
|
+
- **Captions in the clip.** A stranger can't tell what a clip shows without
|
|
513
|
+
them. Burn a plain sentence into each beat ("You deploy an update to your
|
|
514
|
+
shop", "The shop goes down"), about three seconds each, three or four beats.
|
|
515
|
+
The first frame already shows the product and its first caption, never an
|
|
516
|
+
empty screen.
|
|
400
517
|
- **The poster is the finished state.** It is what shows before the clip
|
|
401
518
|
loads, without JavaScript, and under `prefers-reduced-motion`, so it has to
|
|
402
519
|
make the argument on its own (§7: content is visible by default).
|
|
@@ -443,20 +560,78 @@ runs only when the reader asks for it, the same terms as ADR-0009.
|
|
|
443
560
|
Every class starts with `.pp-`, so the file sits beside a site's own stylesheet.
|
|
444
561
|
A page can change `--pp-width` (default 1160px) and `--pp-gutter` on `.pp`.
|
|
445
562
|
|
|
446
|
-
|
|
563
|
+
### 4. Check it, then hand it to a stranger
|
|
564
|
+
|
|
565
|
+
`scripts/fold.mjs` checks the first phone screen and the budgets
|
|
566
|
+
(Playwright, 390 × 844):
|
|
447
567
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
568
|
+
```sh
|
|
569
|
+
npm i --no-save playwright && npx playwright install chromium
|
|
570
|
+
node node_modules/@brignano/design/scripts/fold.mjs https://product.example/ --shots shots
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
Then the **stranger test**, which no script can do. Give the first-screen shot
|
|
574
|
+
from `--shots` to someone outside the field for five seconds, or to a fresh
|
|
575
|
+
agent with no other context, and ask:
|
|
576
|
+
|
|
577
|
+
> You're seeing this website for the first time, on a phone. In one sentence
|
|
578
|
+
> each: what is it, who is it for, and what would you get? Would you tap the
|
|
579
|
+
> button, and what do you expect to happen if you do?
|
|
580
|
+
|
|
581
|
+
Compare the answers to the brief. If What, Who or Get doesn't match it, the
|
|
582
|
+
page fails: fix the words or the proof, and test again. An agent building a
|
|
583
|
+
page runs this before asking for review, and puts the answers in the PR.
|
|
584
|
+
|
|
585
|
+
- [ ] `BRIEF.md` exists and was approved before the page.
|
|
586
|
+
- [ ] `fold.mjs` passes: thesis, audience, proof and action on the first
|
|
587
|
+
screen; within the word budgets; 7 screens or fewer; no sideways scroll.
|
|
588
|
+
- [ ] The stranger test's answers match the brief (in the PR).
|
|
589
|
+
- [ ] The subhead is the Pain, then the fix.
|
|
590
|
+
- [ ] If anything can be tried without signing up, "Try the live demo" is the
|
|
591
|
+
secondary action.
|
|
592
|
+
- [ ] A mark, a hero layout and a proof frame chosen, not all three shared
|
|
593
|
+
with another product.
|
|
594
|
+
- [ ] One signature band, then three how-it-works steps.
|
|
595
|
+
- [ ] One primary action, the same everywhere; the status once in the hero.
|
|
596
|
+
- [ ] Every time, number or superlative is backed, or cut.
|
|
454
597
|
- [ ] A clip has a finished-state poster, a Pause / Play button, and no
|
|
455
598
|
`autoplay` attribute.
|
|
456
|
-
- [ ]
|
|
457
|
-
- [ ] Prices, if any, are a `.pp-price` of two to four options in the close
|
|
458
|
-
band (or one chapter), with no buttons of their own.
|
|
459
|
-
- [ ] Has a copyright footer: `© {year} Anthony Brignano. All rights reserved.`,
|
|
460
|
-
the year filled in at build time, plus Privacy and Terms links for the
|
|
461
|
-
pages the product has.
|
|
599
|
+
- [ ] Copyright footer with the year filled in at build time.
|
|
462
600
|
- [ ] No hex outside `tokens.css` (`npm run check`).
|
|
601
|
+
|
|
602
|
+
## 14. Components
|
|
603
|
+
|
|
604
|
+
Shared controls and patterns ship as plain CSS in
|
|
605
|
+
[`components.css`](./components.css), and whole-page layouts as
|
|
606
|
+
`templates/<name>.css`. Why plain CSS and not React: ADR-0012. What gets built
|
|
607
|
+
and in what order: [`proposals/component-layer.md`](./proposals/component-layer.md).
|
|
608
|
+
|
|
609
|
+
```css
|
|
610
|
+
@import '@brignano/design/tokens.css';
|
|
611
|
+
@import '@brignano/design/components.css';
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
- **One layer.** Everything is inside `@layer brignano.components`. A consumer's
|
|
615
|
+
unlayered CSS and Tailwind utilities beat it without `!important`, so a site
|
|
616
|
+
can adjust a component without fighting it.
|
|
617
|
+
- **Names.** `.name` for the component, `.name-variant` for a variant
|
|
618
|
+
(`.btn`, `.btn-primary`). State is never a class: it comes from the attribute
|
|
619
|
+
that makes it true (`disabled`, `aria-invalid="true"`, `aria-current`,
|
|
620
|
+
`aria-expanded`, `[open]`), so the look can't disagree with what assistive
|
|
621
|
+
tech is told.
|
|
622
|
+
- **Native first.** `<dialog>`, the `popover` attribute, `<details>` and CSS
|
|
623
|
+
anchor positioning before any script. Where a component needs JS (a toast
|
|
624
|
+
queue, tab arrow keys), its preview page documents the ARIA contract and the
|
|
625
|
+
consumer writes the script. Design ships no JS.
|
|
626
|
+
- **Tokens only.** No hex. Every rule here that sets a background is
|
|
627
|
+
contrast-checked in both themes (`npm run check`): its text colour at 4.5:1,
|
|
628
|
+
its border or outline at 3:1. A control's edge is `--line-control`; the
|
|
629
|
+
divider tokens (`--line`, `--line-soft`, `--line-strong`) are exempt from the
|
|
630
|
+
edge check because they are never a control's edge.
|
|
631
|
+
- **Every class is shown.** A class in `components.css` or a template that no
|
|
632
|
+
preview page uses fails the check: if it isn't shown, it isn't reviewed.
|
|
633
|
+
- **Switch or checkbox.** A switch (`.switch`, `role="switch"`) is only for a
|
|
634
|
+
setting that takes effect the moment it flips. Anything sent with a form's
|
|
635
|
+
submit button is a checkbox, because a switch promises an effect the form
|
|
636
|
+
hasn't made yet.
|
|
637
|
+
|
package/README.md
CHANGED
|
@@ -9,7 +9,9 @@ The shared design system for every brignano surface — `brignano.io`, `life`,
|
|
|
9
9
|
| [`DECISIONS.md`](./DECISIONS.md) | Why the values are what they are. ADRs. |
|
|
10
10
|
| [`tokens.css`](./tokens.css) | Single source of truth for colour, type, space, shape, motion. |
|
|
11
11
|
| [`tokens.chart.css`](./tokens.chart.css) | Validated categorical palette for data viz. |
|
|
12
|
-
| [`
|
|
12
|
+
| [`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`. |
|
|
13
|
+
| [`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; a product mark, hero layout and proof frame so each product looks like itself. DESIGN.md §13; skeleton in `previews/product-page.html`, worked example in `previews/product-page-example.html`, first-screen check in `scripts/fold.mjs`. |
|
|
14
|
+
| [`templates/`](./templates) | Page templates built on `components.css`: `article.css` (posts and docs), `changelog.css`, `legal.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`. |
|
|
13
15
|
| [`previews/`](./previews) | Live swatches. Open one in a browser to see the tokens render. |
|
|
14
16
|
|
|
15
17
|
## The shape of it
|
|
@@ -30,6 +32,7 @@ npm install @brignano/design
|
|
|
30
32
|
|
|
31
33
|
```css
|
|
32
34
|
@import '@brignano/design/tokens.css';
|
|
35
|
+
@import '@brignano/design/components.css'; /* buttons, fields, messages… */
|
|
33
36
|
@import '@brignano/design/tokens.chart.css'; /* only if the surface has charts */
|
|
34
37
|
```
|
|
35
38
|
|