diff --git a/CHANGELOG.md b/CHANGELOG.md index 398b5bd..7f7ca63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 0.10.0 + +Driven by round 7 and a second opinion from a stronger model: the skill's own taste rules banned or penalised the moves that made the baseline pages memorable. **Not yet evaluated:** nothing here shows the pages are now more distinctive. + +- **Pages that persuade may shout.** On `data-mode="persuade"` or `experience`, heavy weights and tracked capitals are no longer tells or drift flags; italic, full stops, strong colour and long headlines are allowed when the concept chooses them. Working screens keep every rule. +- **A seven-line concept:** adds one headline move only this product's headline could make, and a voice (face, weight, case, loudness). "Keep the rest calm" is gone. +- **Three display voices** under the Open Font Licence: Bricolage Grotesque, Newsreader (with italic) and Big Shoulders Display, beside Geist. `scaffold --kind base` now requires `--voice` and `--weight`, and writes letter spacing measured for that face and weight. +- **The base lost its house furniture:** no button arrow, no monospace captions, no dimmed second headline line. +- **Gate guidance:** the checks find faults in a chosen design; do not design toward the score. + ## 0.9.0 Driven by round 6, where skilled pages lost on distinctiveness because they shared one frame. diff --git a/README.md b/README.md index 2832070..934d781 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ Review this screen against our brand guide. | --- | --- | --- | | 1 | **Read** | Finds your design rules, watches the screens run and measures the drift. | | 2 | **Decide the mode** | Persuade, Operate, Read, Experience or Terminal: what the person is doing here. | -| 3 | **Fix the direction** | A five-line concept (what the product makes, what the page shows without its category word, one signature, a layout taken from that artifact, one material that runs through), then five lines on how it should feel and what it must never look like. | +| 3 | **Fix the direction** | A seven-line concept (what the product makes, what the page shows without its category word, one signature, a layout taken from that artifact, one material that runs through, one headline move, and a voice: face, weight, case and loudness), then five lines on how it should feel and what it must never look like. | | 4 | **Branch** | Repairs an existing screen layer by layer, or builds a new one around one star. | | 5 | **Build** | One section at a time, from your own components, with every state designed. | | 6 | **Gate** | Runs your lint, types and tests, then measures contrast, target size and tells. | @@ -124,14 +124,14 @@ Review this screen against our brand guide. A blank file loses the craft, and a finished template loses the identity. So a new landing page starts from a base with tested type, controls and motion and no layout, and the agent builds the layout from the product’s own artifact. There are also two complete starters for when the standard shape is what you want. All of them pass the skill’s craft checks. ```bash -node scripts/scaffold.mjs my-page --kind base --theme light +node scripts/scaffold.mjs my-page --kind base --theme light --voice serif --weight 600 node scripts/scaffold.mjs my-standard-page --theme light --palette ember --shape contour node scripts/scaffold.mjs my-app --kind app --theme dark ``` | Starter | What you get | | --- | --- | -| **Base** (`--kind base`) | Type with tracking set by size, buttons and links with hover and press, focus styles, colour, the motion kit and fonts. `page.css` is empty: the frame is yours. | +| **Base** (`--kind base`) | Buttons and links with hover and press, focus styles, colour, the motion kit and fonts. You choose the headline face and weight (`--voice sans`, `grotesk`, `serif` or `condensed`, with `--weight`), and the letter spacing measured for them is written in. `page.css` is empty: the frame is yours. | | **Landing page** | A lit grainient ground, a floating nav, a product frame, an uneven bento, steps, one big number, a closing call and a footer. The motion kit is wired in: ordered entrance, scroll reveals, count-up, and a hover and press state on every control. | | **App screen** (`--kind app`) | A sidebar that becomes a menu on a phone, a page header with one primary action, four key numbers, one chart, a table whose status is a word and a dot, and an empty state that says what to do. | @@ -187,6 +187,7 @@ references/ assets/motion/ the motion kit: entrance, reveal, count-up, magnetic, tilt, spotlight, marquee, draw, sweep buttons assets/starters/ the landing and app starters, tested in a browser assets/fonts/ Geist, Geist Mono and Instrument Serif under the Open Font Licence +assets/voices/ Bricolage Grotesque, Newsreader and Big Shoulders Display, same licence assets/recipes/ tested generators and kits: grounds, flat colour tones, duotone prints, annotation chips and diagrams, headline helpers, contours, stones, vessels, dither, halftone, HUD callouts, isometric art scripts/ the measuring and building tools above evals/ briefs, scoring, a tracking measurement and the write-up of every test round diff --git a/SKILL.md b/SKILL.md index b64b3bf..8168007 100644 --- a/SKILL.md +++ b/SKILL.md @@ -26,8 +26,8 @@ One fixed run for every request. Do the steps in order. Each step names the file | --- | --- | --- | --- | | 1 | **Read** | Find the project's design rules, establish what is real, see the screens running, measure the drift | [references/read.md](references/read.md) | | 2 | **Decide the mode** | Persuade, Operate, Read, Experience or Terminal: what the person is doing here | [references/modes.md](references/modes.md) | -| 3 | **Fix the direction** | The concept in five lines (native artifact, the page without its category word, one signature and why this ground, the layout taken from the artifact, one material that runs through), then five lines: product, character, world, moments, signature. From the project's rules if it has them | [references/direction.md](references/direction.md), [devices.md](references/devices.md) | -| 4 | **Branch** | Existing screen: repair layer by layer. New screen: build around one star. **A new landing page starts from `scripts/scaffold.mjs --kind base`**: tested type and controls, your own layout | [fix.md](references/fix.md) or [build-new.md](references/build-new.md) | +| 3 | **Fix the direction** | The concept in seven lines (native artifact, the page without its category word, one signature and why this ground, the layout taken from the artifact, one material that runs through, one headline move, the voice: face, weight, case and loudness), then five lines: product, character, world, moments, signature. From the project's rules if it has them | [references/direction.md](references/direction.md), [devices.md](references/devices.md) | +| 4 | **Branch** | Existing screen: repair layer by layer. New screen: build around one star. **A new landing page starts from `scripts/scaffold.mjs --kind base --voice … --weight …`**: tested type and controls, your own layout | [fix.md](references/fix.md) or [build-new.md](references/build-new.md) | | 5 | **Build** | One section at a time, from the project's own parts, with every state | [build.md](references/build.md), [components.md](references/components.md), [motion.md](references/motion.md), [hover.md](references/hover.md), [materials.md](references/materials.md) | | 6 | **Gate** | The project's checks, then measured design checks | [references/gate.md](references/gate.md) | | 7 | **Look** | Render at four widths, hover every control, fix what shows, up to three rounds | [look.md](references/look.md), [feels-cheap.md](references/feels-cheap.md), [hover.md](references/hover.md) | @@ -42,13 +42,13 @@ Also load, as the work needs them: the surface file for the mode ([web-app](refe 2. **What exists is evidence, not approval.** Sloppy styling already in the code is never a rule. 3. **Decide, do not interrogate.** A vague request gets a one-line reading and a start. Ask only when a missing fact blocks the work. Never ask about colours, fonts or vibe. If nobody can answer (a one-shot or non-interactive run), state your assumptions in the report and proceed; never stall. 4. **Keep the product.** Features, content and section order stay. Do not rename it, invent features, claims, data or customers. -5. **Never replace decoration with decoration.** Removing a tell leaves space; fill it with scale, real content, or nothing. -6. **Remove the tells** in `anti-slop.md` as part of the work. Say so only if it mattered. +5. **On a working screen, never replace decoration with decoration.** Removing a tell leaves space; fill it with scale, real content, or nothing. +6. **Remove the tells** in `anti-slop.md` as part of the work. Say so only if it mattered. A page that persuades may shout: heavy or condensed headlines, tracked capitals, italic, a full stop, more than one strong colour are choices there (`anti-slop.md`, first section). 7. **Reuse first.** The project's components, tokens and icon set, then a library it already uses. Add a new piece only when nothing fits, and name it. A new dependency is the person's decision: ask, and check the licence (`libraries.md`). 8. **Look before you show.** Render the real screen at 320, 390, 1440 and 2560 px (terminal: 60 and 120 columns). Do not claim a width looks fine if you did not render it. 9. **Measure, do not guess.** Run the scripts. The report's numbers come from them. 10. **Be honest.** If a check fails, say so with the output. If a step was skipped, say that. If something is left over, list it. -11. **Own the frame, not only the artwork.** A good picture inside the usual layout is still a template. Write the concept (`direction.md`) before the first scaffold, take the layout from the shape of the artifact, carry one material through the page, keep the rest calm, and pass the swap and frame checks at the gate. +11. **Own the frame, not only the artwork.** A good picture inside the usual layout is still a template. Write the concept (`direction.md`) before the first scaffold, take the layout from the shape of the artifact, carry one material through the page, give the headline a move of its own, and pass the swap and frame checks at the gate. 12. **Every control answers.** Each interactive element gets a designed hover and a press state, and a page gets one entrance. Look at the hover state, not only the resting one. ## Tools @@ -61,7 +61,7 @@ Plain Node 22+ scripts in `scripts/`, no installs, using the Chrome on the machi | `scripts/drift.mjs --save before.json` | Counts font sizes, weights, radii, colours, spacing in use; later `--against before.json` | | `scripts/signs.mjs [--allow "Tell"]` | Finds machine-made tells in the rendered page; `--allow` licenses devices a committed direction uses on purpose | | `scripts/check.mjs ` | Contrast, touch-target size, small text, missing names | -| `scripts/scaffold.mjs --kind base` | Starts a page with the craft and no layout: type with tracking by size, controls, focus, colour, motion kit and open fonts; you write `page.css` from the concept. `--theme`, `--accent`, or `--palette` (a lit palette, or the flat tones `cobalt`, `mint`, `sand`). `--kind landing` (the default of the script) is the whole standard page, for a brief that asks for the standard shape or cannot spare the time; its frame is shared by every page started from it (flags in `landing-craft.md`). `--kind app` starts an app screen: sidebar, header, key numbers, chart, table and empty state. `inline.mjs --out page.html` folds the result into one file | +| `scripts/scaffold.mjs --kind base --voice serif --weight 600` | Starts a page with the craft and no layout: controls, focus, colour, motion kit and open fonts, with the headline face and weight you choose (`sans`, `grotesk`, `serif`, `condensed`; both required) and tracking measured for them; you write `page.css` from the concept. `--theme`, `--accent`, or `--palette` (a lit palette, or the flat tones `cobalt`, `mint`, `sand`). `--kind landing` (the default of the script) is the whole standard page, for a brief that asks for the standard shape or cannot spare the time; its frame is shared by every page started from it (flags in `landing-craft.md`). `--kind app` starts an app screen: sidebar, header, key numbers, chart, table and empty state. `inline.mjs --out page.html` folds the result into one file | | `scripts/lib-add.mjs add bencho ` | Pulls real source from Bencho, BoardUI, Aceternity or any shadcn registry (files only, with a licence notice and the packages to install). See `libraries.md` | | `scripts/craft.mjs [--shots dir]` | Hovers every control with a real pointer and diffs both the computed style and the pixels, so a control that ignores the pointer, or answers it invisibly, is caught; also flags transitions on layout properties and motion that ignores the reduced-motion setting | | `scripts/dotify.mjs --mode hex` | Turns any picture or drawn SVG into dithered, halftone, hex-dot, engraved-line or ASCII art for a hero object; `--fill` and `--bg` make it a two-colour duotone | diff --git a/assets/starters/base/base.css b/assets/starters/base/base.css index cf46bcb..53c5522 100644 --- a/assets/starters/base/base.css +++ b/assets/starters/base/base.css @@ -15,19 +15,17 @@ a { color: inherit; } /* ---------- Shape: one radius decision for the whole page. 999px, 0.75rem or 0, and mean it. ---------- */ :root { --shape: 999px; --gutter: clamp(1rem, 4vw, 3rem); } -/* ---------- Type: roles, with tracking that follows size (evals/tracking.mjs) ---------- */ -.display { margin: 0; font: 400 clamp(2.75rem, 6vw, 6rem)/0.98 var(--sans); letter-spacing: -0.03em; text-wrap: balance; } -@media (min-width: 62rem) { .display { letter-spacing: -0.04em; } } -@media (min-width: 80rem) { .display { letter-spacing: -0.05em; } } -@media (min-width: 96rem) { .display { letter-spacing: -0.055em; } } -.h2 { margin: 0; max-width: 22ch; font: 400 clamp(2rem, 4vw, 3.5rem)/1.08 var(--sans); letter-spacing: -0.02em; text-wrap: balance; } -@media (min-width: 80rem) { .h2 { letter-spacing: -0.03em; } } -.h3 { margin: 0; font: 500 1.25rem/1.25 var(--sans); text-wrap: balance; } -.lede { max-width: 34rem; margin: 0; font-size: 1.1875rem; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; } -.note { margin: 0; font: 400 0.8125rem/1.4 var(--mono); color: var(--ink-3); } -.dim { color: var(--ink-3); } +/* ---------- Type: the face and weight come from theme.css, with tracking measured for them ---------- */ +/* Margins carry no specificity, so the stacking rule below and your page.css both win. */ +:where(.display, .h2, .h3, .lede, .note, .actions) { margin: 0; } +.display { font: var(--display-weight) clamp(2.75rem, 6vw, 6rem)/0.98 var(--display); letter-spacing: var(--track-1); text-wrap: balance; } +@media (min-width: 62rem) { .display { letter-spacing: var(--track-2); } } +@media (min-width: 80rem) { .display { letter-spacing: var(--track-3); } } +.h2 { max-width: 22ch; font: var(--display-weight) clamp(2rem, 4vw, 3.5rem)/1.08 var(--display); letter-spacing: var(--track-h2); text-wrap: balance; } +.h3 { font: 600 1.25rem/1.25 var(--sans); text-wrap: balance; } +.lede { max-width: 34rem; font-size: 1.1875rem; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; } +.note { font-size: 0.8125rem; line-height: 1.4; color: var(--ink-3); } .num { font-variant-numeric: tabular-nums; } -.dec { color: var(--ink-3); } p { max-width: 65ch; text-wrap: pretty; } /* ---------- Controls ---------- */ @@ -36,7 +34,7 @@ p { max-width: 65ch; text-wrap: pretty; } .m-btn.large { min-height: 3.25rem; padding: 0 1.5rem; font-size: 1rem; } .m-link { display: inline-flex; align-items: center; min-height: 2.75rem; min-width: 2.75rem; } .m-link:hover, .m-link:focus-visible { color: var(--accent); } -.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; } +.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; } /* ---------- The few blocks every page needs, left plain ---------- */ .top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem var(--gutter); } @@ -44,5 +42,5 @@ p { max-width: 65ch; text-wrap: pretty; } .brand:hover, .brand:focus-visible { color: var(--accent); } :where(.first, .last) { padding: clamp(3rem, 8vw, 7rem) var(--gutter); } :where(.first, .last) > * + * { margin-top: 1.5rem; } -.legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 1.5rem var(--gutter); font: 400 0.8125rem/1.4 var(--mono); color: var(--ink-3); border-top: 1px solid var(--line); } +.legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 1.5rem var(--gutter); font-size: 0.8125rem; color: var(--ink-3); border-top: 1px solid var(--line); } @media (max-width: 40rem) { .actions .m-btn { flex: 1 1 100%; justify-content: center; } } diff --git a/assets/starters/base/index.html b/assets/starters/base/index.html index 4433bec..b84a287 100644 --- a/assets/starters/base/index.html +++ b/assets/starters/base/index.html @@ -1,5 +1,5 @@ - + @@ -17,6 +17,8 @@ @@ -43,7 +45,7 @@

One clear next step.

One sentence that makes the next step feel small.

-

Primary action

+

Primary action

diff --git a/assets/voices/OFL-big-shoulders.txt b/assets/voices/OFL-big-shoulders.txt new file mode 100644 index 0000000..b5a4e0d --- /dev/null +++ b/assets/voices/OFL-big-shoulders.txt @@ -0,0 +1,93 @@ +Copyright 2019 The Big Shoulders Project Authors (https://github.com/xotypeco/big_shoulders) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/voices/OFL-bricolage.txt b/assets/voices/OFL-bricolage.txt new file mode 100644 index 0000000..a397658 --- /dev/null +++ b/assets/voices/OFL-bricolage.txt @@ -0,0 +1,93 @@ +Copyright 2022 The Bricolage Grotesque Project Authors (https://github.com/ateliertriay/bricolage) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/voices/OFL-newsreader.txt b/assets/voices/OFL-newsreader.txt new file mode 100644 index 0000000..d2d4f40 --- /dev/null +++ b/assets/voices/OFL-newsreader.txt @@ -0,0 +1,93 @@ +Copyright 2020 The Newsreader Project Authors (http://github.com/productiontype/Newsreader) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. \ No newline at end of file diff --git a/assets/voices/big-shoulders.woff2 b/assets/voices/big-shoulders.woff2 new file mode 100644 index 0000000..d0bb518 Binary files /dev/null and b/assets/voices/big-shoulders.woff2 differ diff --git a/assets/voices/bricolage.woff2 b/assets/voices/bricolage.woff2 new file mode 100644 index 0000000..82152a4 Binary files /dev/null and b/assets/voices/bricolage.woff2 differ diff --git a/assets/voices/newsreader-italic.woff2 b/assets/voices/newsreader-italic.woff2 new file mode 100644 index 0000000..11a48ec Binary files /dev/null and b/assets/voices/newsreader-italic.woff2 differ diff --git a/assets/voices/newsreader.woff2 b/assets/voices/newsreader.woff2 new file mode 100644 index 0000000..816261a Binary files /dev/null and b/assets/voices/newsreader.woff2 differ diff --git a/assets/voices/voices.css b/assets/voices/voices.css new file mode 100644 index 0000000..5576eef --- /dev/null +++ b/assets/voices/voices.css @@ -0,0 +1,6 @@ +/* Display voices (SIL Open Font Licence 1.1, see the OFL files beside them). scaffold.mjs --kind base copies the one a + page asks for into its fonts folder. Latin subset. */ +@font-face { font-family: "Bricolage Grotesque"; src: url("bricolage.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; } +@font-face { font-family: "Newsreader"; src: url("newsreader.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; } +@font-face { font-family: "Newsreader"; src: url("newsreader-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; } +@font-face { font-family: "Big Shoulders Display"; src: url("big-shoulders.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; } diff --git a/evals/README.md b/evals/README.md index 9017e0a..d88f953 100644 --- a/evals/README.md +++ b/evals/README.md @@ -62,3 +62,14 @@ A page's visual score is the sum (out of 50). Judge blind where possible: shuffl ## Why two arms Without the baseline you cannot tell whether the skill helped or the model is simply good. Without the skilled arm's own report you cannot tell why it fell short. Both are needed to improve the skill rather than admire it. + +## Before claiming a win on distinctiveness + +One build per arm can show a loss, not a win: in round 7 the same baseline pages moved from 4.5 to 3.33 mean ownability between two sets of judges. To claim that the skill helps: + +- At least six briefs the skill has never seen, three builds per arm for each (36 pages). +- **Spread first:** judge the three builds of one brief against each other. If skilled builds look more alike than baseline builds, the skill is narrowing the output, whatever the pairs say. +- **Lineup:** show a judge the first screens, names masked, and ask them to group them by hand. Score how well the groups match the arms. +- At least one judge from a different model family, and one pass with text blurred. +- Pass bar: remembered and less swappable in 60% or more of at least 36 pair judgements, with the skill's own scores left out. + diff --git a/package.json b/package.json index 1ea1f55..6a2a910 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "inimitable", - "version": "0.9.0", + "version": "0.10.0", "description": "A design skill for coding agents: builds and fixes interfaces until they look made on purpose.", "type": "module", "license": "Apache-2.0", diff --git a/references/anti-slop.md b/references/anti-slop.md index 1702fc7..4197aee 100644 --- a/references/anti-slop.md +++ b/references/anti-slop.md @@ -8,6 +8,17 @@ A third caution: a tell can be a **choice**. When the project's direction (`dire Two cautions. First, removing a tell leaves space: never fill that space with a different trend (glass, grain, neon, bento boxes). Fill it with scale, real content or nothing. Second, a tell that is part of the project's own brand guide is not a tell for that project. Keep it and say so. +## Pages that persuade + +Much of this list describes a **working screen**, where calm helps a person work. A landing page or a showpiece (Persuade and Experience modes) has the opposite job: to be remembered. In blind comparisons, pages that followed the working-screen rules here read as one quiet template, while pages that broke them were remembered. On a page marked `` (or `experience`), these are **choices made in the concept**, not tells: + +- headline weight 800 or 900, a condensed or italic display face, a full stop in a headline +- small capitals with wide tracking, used as part of the voice +- a strong coloured ground, more than one strong colour, hard shadows, a drawn texture that carries the material +- a headline over three lines, when the lines are the layout + +`signs.mjs` and `drift.mjs` read the mark and stop flagging heavy weights and tracked capitals. Everything else in this file still holds, and so do contrast, target size, overflow and honesty. A choice is made once and used with purpose; five unrelated effects are still noise. + ## Surfaces and colour - `[scan]` Violet-to-blue, violet-to-pink or any hue-to-hue gradient on backgrounds, cards, buttons or the active nav item → one neutral surface, accent only where it means something. **Exception:** a lit ground in one temperature family with grain, licensed by the direction (`materials.md`), is a material, not a tell. A rainbow is still a rainbow. diff --git a/references/build-new.md b/references/build-new.md index f7896b0..38dac38 100644 --- a/references/build-new.md +++ b/references/build-new.md @@ -16,9 +16,9 @@ The brand decides. It does not have to be a colour. A brand that is black and gr ## Steps -Before step 1, check that the concept exists (`direction.md`: native artifact, the page without its category word, one signature and why this ground, layout, material). The star below is usually the signature. If the concept is missing, write it now; a scaffold without it produces the genre page every product in the category already has. +Before step 1, check that the concept exists (`direction.md`: native artifact, the page without its category word, one signature and why this ground, layout, material, headline move, voice). The star below is usually the signature. If the concept is missing, write it now; a scaffold without it produces the genre page every product in the category already has. -For a working app screen (dashboard, list, settings), run `node scripts/scaffold.mjs --kind app` instead (`surfaces/web-app.md`). For a landing page, run `node scripts/scaffold.mjs --kind base` first. It carries the type, controls, motion and hover states and **no layout**: write `page.css` from concept lines 4 and 5, and use the motion kit and recipes as parts (`landing-craft.md`). Use the full landing starter (`--kind landing`) only when the brief asks for the standard page or there is no time to compose one, and say so in the report, because its frame is shared. +For a working app screen (dashboard, list, settings), run `node scripts/scaffold.mjs --kind app` instead (`surfaces/web-app.md`). For a landing page, run `node scripts/scaffold.mjs --kind base --voice … --weight …` first, with the voice from concept line 7. It carries the controls, motion and hover states and **no layout**: write `page.css` from concept lines 4 to 7, and use the motion kit and recipes as parts (`landing-craft.md`). Use the full landing starter (`--kind landing`) only when the brief asks for the standard page or there is no time to compose one, and say so in the report, because its frame is shared. 1. **Name the star** in one sentence, and say why it belongs to this product (use the subject inventory from Read). 2. **Write the screen's argument**, one line: who arrives, what they need to leave with, what they do next. diff --git a/references/direction.md b/references/direction.md index 8cdb289..0953302 100644 --- a/references/direction.md +++ b/references/direction.md @@ -1,10 +1,10 @@ # Step 3: Fix the direction -The direction is a five-line concept and five short lines, written before anything is edited or scaffolded. It is what keeps forty small decisions pointing the same way. Write it from the product in front of you, never from what is fashionable. +The direction is a seven-line concept and five short lines, written before anything is edited or scaffolded. It is what keeps forty small decisions pointing the same way. Write it from the product in front of you, never from what is fashionable. -## First: the concept (five lines) +## First: the concept (seven lines) -A page is replaceable when only its words and its picture are its own. A strong picture inside the usual frame (a thin nav with one dark button, a headline beside a card, three steps, a closing panel) still reads as one more template: in round 6 of the evals, judges called every skilled page interchangeable for exactly that reason, while pages that carried the product's own material from top to bottom were the ones they remembered. Decide what the page shows, **how it is laid out and what it is made of**, from the subject inventory, before the scaffold and before any colour. +A page is replaceable when only its words and its picture are its own. A strong picture inside the usual frame (a thin nav with one dark button, a headline beside a card, three steps, a closing panel) still reads as one more template: in round 6 of the evals, judges called every skilled page interchangeable for exactly that reason, while pages that carried the product's own material from top to bottom were the ones they remembered. Decide what the page shows, **what its headline does, what voice it speaks in, how it is laid out and what it is made of**, from the subject inventory, before the scaffold and before any colour. Answer in order: @@ -24,14 +24,28 @@ Answer in order: 5. **Material.** One thing the artifact is made of: its scale, rule, unit, mark or texture. Draw it in the page itself, on the first screen and in at least two more places, or as one line that runs down the page. Mark each with `data-device="name"`. It has to mean something (a scale that reads real or example values, a rule that separates real parts). A texture sprinkled for decoration is not a material. +6. **Headline.** One move that only this product's headline could make: a word struck out and replaced, a figure set into the line, a break that follows the artifact, a mark the artifact itself uses. The words alone being specific is not a move. If the artifact has no gesture, the move is scale: set the headline far larger than feels safe and let it be the layout. +7. **Voice.** The face, the weight, the case and how loud the page is. Decide all four from the artifact's world, then pass the first two to the scaffold. + + | `--voice` | Face | It sounds like | Weight range | + | --- | --- | --- | --- | + | `sans` | Geist | an instrument, a tool | 100 to 900 | + | `grotesk` | Bricolage Grotesque | a poster, a shopfront, something made by hand | 200 to 800 | + | `serif` | Newsreader, with italic | print: a document, a journal, a letter | 200 to 800 | + | `condensed` | Big Shoulders Display | signage, a timetable, a crate stencil | 100 to 900 | + + A regular weight, in sentence case, on a pale neutral ground is what a page gets when nobody decides. It can be right; if you land on all three, write the reason beside this line. + Then pick the **ground on purpose**: lit (the soft grainy gradient), flat colour, a dark framed panel, a duotone, or the artifact itself. The lit gradient is the default of machine-built pages now, so it needs a reason of its own (`landing-craft.md` decision 1, `directions.md`). -Write it as five lines and keep it where the run can see it (the top of the report, and the project's notes in the Log step). An example, for a harbour tide app: +Write it as seven lines and keep it where the run can see it (the top of the report, and the project's notes in the Log step). An example, for a harbour tide app: ```text Artifact: a tide curve for one day, at the moment the water is high enough to launch. Without the category word: one curve across the whole screen, the launch window shaded on it, the headline riding above. Signature: the curve answers the pointer with the depth at that hour. Ground: flat deep water blue, because the curve is the picture. +Headline: the line sits on the curve, and the word "launch" rides at the height of high water. +Voice: condensed, 800, capitals, loud, like a harbour notice board. Layout: across. Every section sits on the same hour axis; there is no card and no panel. Material: the hour ticks, on the curve, under each section heading and along the footer. ``` diff --git a/references/directions.md b/references/directions.md index 1a57a6b..ff01852 100644 --- a/references/directions.md +++ b/references/directions.md @@ -155,6 +155,6 @@ The finished looks above are starting points. What makes one feel *made for this - The **hero object** drawn from its world, not a generic sphere or chip. - **Real labels** from its real facts. - **One accent** from its world or brand. -- **One signature** (a status dot, a unit, a typeface detail, one artwork, one interaction) used everywhere, with everything else calm. +- **One signature** (a status dot, a unit, a typeface detail, one artwork, one interaction) used everywhere. If you could swap the product name and the page still fits, it is a template. Go back to the inventory. diff --git a/references/gate.md b/references/gate.md index a8a2ea4..b1bd856 100644 --- a/references/gate.md +++ b/references/gate.md @@ -12,6 +12,8 @@ Find them (`package.json` scripts, `Makefile`, CI config, `CLAUDE.md`): usually ## Half two: design checks, measured +These checks find faults in a design you have already chosen. Do not design toward the score: a page can pass all of them and be forgettable. When a check argues with a choice the concept made on purpose, fix contrast, size and overflow without argument, and keep the choice. + | Check | Command | Passes when | | --- | --- | --- | | Drift | `node scripts/drift.mjs --against before.json` | font sizes, weights, radii, colour hues and off-grid values are the same or lower than before, and within the scale | diff --git a/references/house-rules.md b/references/house-rules.md index cc46bc6..7b3fa5f 100644 --- a/references/house-rules.md +++ b/references/house-rules.md @@ -4,6 +4,8 @@ Default numbers and rules for when a project has none of its own. If the project ## The ten rules +Rules 3, 4 and 8 are written for working screens. A page that persuades may use heavier weights, more than one strong colour and a drawn texture when its concept says why (`anti-slop.md`, "Pages that persuade"). + 1. **One spacing grid.** Every margin, padding, gap and fixed height is a multiple of 4. Scale: 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96, 128. 2. **One neutral ramp.** Background, raised surface, border and text all come from a single tinted grey ramp. Three text roles: primary, secondary, muted. 3. **One accent, used rarely.** It marks the primary action, the selection, or the one number that matters. If the brand has no accent, the star of a screen is made with size and contrast instead. @@ -91,7 +93,7 @@ Tightest tracking by size, measured (`node evals/tracking.mjs`, which draws ever | 80 to 96 px | -0.055em | 0 | | 128 px and up | -0.06em | -0.01em for numerals only | -Use less than the limit, never more. The sans takes tight tracking well, which is why tracked-in headlines suit it. The serif is drawn tightly already, so it takes none: at -0.03em about one pair in five touches. Another face needs its own run (`node evals/tracking.mjs --font "Name" --css fonts.css`). The landing starter follows this table in steps by width, and `test/tracking.test.mjs` holds it to the measurement at six widths, so a value taken from a reference at one size is not copied to another. These numbers say where letters begin to touch, not what looks best, and they are for a regular weight: a heavier weight needs more room. +Use less than the limit, never more. The sans takes tight tracking well, which is why tracked-in headlines suit it. The serif is drawn tightly already, so it takes none: at -0.03em about one pair in five touches. Another face needs its own run (`node evals/tracking.mjs --font "Name" --css fonts.css`). The landing starter follows this table in steps by width, and `test/tracking.test.mjs` holds it to the measurement at six widths, so a value taken from a reference at one size is not copied to another. These numbers say where letters begin to touch, not what looks best, and they are for a regular weight: a heavier weight needs more room. `scaffold --kind base` writes measured tracking for the voice and weight you choose, and `test/base.test.mjs` holds it to the measurement. Families by character: diff --git a/references/landing-craft.md b/references/landing-craft.md index 6d8e221..e149710 100644 --- a/references/landing-craft.md +++ b/references/landing-craft.md @@ -2,7 +2,7 @@ A good landing page is not a layout with a nice colour. It is a handful of decisions made together: **where the light comes from, where the type sits in it, what is big, what moves and in what order, and how everything answers the pointer.** This file explains each decision, why it works on a person, how to build it with the kits in this skill, and which script catches it when it is wrong. -Start a landing page with `node scripts/scaffold.mjs --kind base [--theme dark|light] [--palette name] [--accent '#hex']`: tested type, controls, motion and fonts, and a `page.css` that is yours. The decisions below are the parts to build it from. Grounds come from `assets/recipes/mesh.mjs` and `flat.mjs`, prints from `duotone.mjs`, chips and diagrams from `annotate.mjs`. +Start a landing page with `node scripts/scaffold.mjs --kind base --voice sans|grotesk|serif|condensed --weight 400 [--theme dark|light] [--palette name] [--accent '#hex']`: tested controls, motion and fonts, the headline voice the concept chose, and a `page.css` that is yours. The decisions below are the parts to build it from. Grounds come from `assets/recipes/mesh.mjs` and `flat.mjs`, prints from `duotone.mjs`, chips and diagrams from `annotate.mjs`. The full landing starter, `node scripts/scaffold.mjs [--theme dark|light] [--palette name] [--shape rays|bowl|blob|...] [--hero stack|split|card] [--ground lit|flat|frame] [--art column|vase|sphere|drape|strata] [--motes]`, builds the standard page in one go. `--hero split` puts the headline beside one object (`--art` fills it with a duotone print as a stand-in); `--hero card` centres the headline and crops a product card at the fold; `--ground flat` or `frame` swaps the lit gradient for a colour (`--palette cobalt|mint|sand`); `--minimal` keeps the hero, the steps, the closing call and the footer. Every page it makes shares one frame, so use it when the brief asks for the standard page or there is no time to compose one. (An app screen is a different starter: `--kind app`, see `surfaces/web-app.md`.) To deliver a single file, run `node scripts/inline.mjs --out page.html`. diff --git a/references/lessons.md b/references/lessons.md index d89fdfd..1139931 100644 --- a/references/lessons.md +++ b/references/lessons.md @@ -12,7 +12,7 @@ General lessons (a tell the list missed, a rule that backfired, a check that wou ## What is worth recording -- The concept (the five lines from `direction.md`) and which ground was chosen and why, so a later run extends the idea instead of replacing it. +- The concept (the seven lines from `direction.md`) and which ground was chosen and why, so a later run extends the idea instead of replacing it. - A decision a future run would otherwise reverse (accent colour reserved for live states). - A surprise (a font that renders wrong on Windows; a component that cannot take a prop). - A correction from the person, with the reason. diff --git a/references/report.md b/references/report.md index a79a406..31b5b1d 100644 --- a/references/report.md +++ b/references/report.md @@ -5,7 +5,7 @@ Short. Written for the person who asked, in plain words, with whatever *they* wo ## Always include - **The mode** used (one word) and the direction (one sentence). -- **The concept** for a new Persuade or Experience screen: the five lines from `direction.md`. +- **The concept** for a new Persuade or Experience screen: the seven lines from `direction.md`. - **The swap test**, one line: what the first screen says that only this product could say, or what it still lacks (`gate.md`). - **What changed**, a few lines, grouped by what the person will notice, not by file. - **Anything left over**, honestly: what you could not fix and why, what you did not touch on purpose. diff --git a/references/surfaces/landing.md b/references/surfaces/landing.md index acecfb0..9b519ab 100644 --- a/references/surfaces/landing.md +++ b/references/surfaces/landing.md @@ -1,6 +1,6 @@ # Surface: landing and marketing pages (Persuade) -**Start with `node scripts/scaffold.mjs --kind base`** (see `landing-craft.md`). It writes the craft with no layout: type with tracking by size, controls with hover and press, focus styles, colour and the motion kit. Build the layout in `page.css` from the concept (`direction.md`): the shape of the product's artifact, and one material that runs through. The full starter (no `--kind`) writes the standard page, for a brief that asks for exactly that or has no time for more. Starting from a blank file loses the craft; stopping at the starter loses the identity. +**Start with `node scripts/scaffold.mjs --kind base --voice … --weight …`** (see `landing-craft.md`). It writes the craft with no layout: the headline voice your concept chose, controls with hover and press, focus styles, colour and the motion kit. Build the layout in `page.css` from the concept (`direction.md`): the shape of the product's artifact, and one material that runs through. The full starter (no `--kind`) writes the standard page, for a brief that asks for exactly that or has no time for more. Starting from a blank file loses the craft; stopping at the starter loses the identity. A landing page is not a brochure. It is an **argument** made in a fixed order, to someone who is deciding whether to keep reading. Design is the product here: the page has to earn attention, then belief, then action, and it has about five seconds to earn the first one. diff --git a/scripts/lib/drift-report.mjs b/scripts/lib/drift-report.mjs index 8eab51a..242e10a 100644 --- a/scripts/lib/drift-report.mjs +++ b/scripts/lib/drift-report.mjs @@ -60,7 +60,8 @@ export function analyse(raw, { scale = SCALE } = {}) { if (working.length > 7) flags.push(`${working.length} working font sizes under 40 px (a scale needs about 7 or fewer)`); if (display.length > 4) flags.push(`${display.length} display sizes at 40 px and up (keep to about 4: headline, numeral, statement, price)`); if (tinyText.length) flags.push(`text smaller than 12 px: ${tinyText.join(', ')}`); - if (weights.some((w) => w >= 700)) flags.push(`weights ${weights.filter((w) => w >= 700).join(', ')} in use (heavy)`); + const loud = /^(persuade|experience)$/.test(raw.mode || ''); + if (!loud && weights.some((w) => w >= 700)) flags.push(`weights ${weights.filter((w) => w >= 700).join(', ')} in use (heavy)`); if (weights.length > 3) flags.push(`${weights.length} font weights in use`); const proportional = Object.keys(raw.fontFamilies).filter((f) => !MONO.test(f)); if (proportional.length > 2) flags.push(`${proportional.length} proportional font families in use (one family plus one partner is the rule; a mono for code or figures is extra)`); diff --git a/scripts/lib/probe.mjs b/scripts/lib/probe.mjs index e9d823f..4894a1c 100644 --- a/scripts/lib/probe.mjs +++ b/scripts/lib/probe.mjs @@ -83,6 +83,7 @@ for (const el of document.querySelectorAll('body, body *')) { if (v > 0) tally(out.spacing, v); } } +out.mode = document.documentElement.dataset.mode || ''; return out; })()`; @@ -100,6 +101,8 @@ const VAGUE_ERROR = new RegExp(${JSON.stringify(VAGUE_ERROR_PATTERN)}, 'i'); const EMOJI = /(?![\\u00A9\\u00AE\\u2122])\\p{Extended_Pictographic}/u; const found = []; const add = (tell, el, detail) => found.push({ tell, where: describe(el), detail: String(detail).slice(0, 90) }); +// A page that persuades may shout: heavy headlines and tracked capitals are choices there, and tells on a working screen. +const loud = /^(persuade|experience)$/.test(document.documentElement.dataset.mode || ''); function hue(rgba) { const [r, g, b] = rgba.slice(0, 3).map((v) => v / 255); const max = Math.max(r, g, b), min = Math.min(r, g, b), d = max - min; @@ -180,8 +183,8 @@ for (const el of document.querySelectorAll('body, body *')) { if (colour && hue(colour) !== null) add('Coloured glow', el, s.filter); } if (text) { - if ((heading || size >= 24) && weight >= 800) add('Heavy heading', el, 'weight ' + weight + ': ' + text); - if (s.textTransform === 'uppercase' && size < 16 && px(s.letterSpacing) / size > 0.04 && text.length > 3) add('Uppercase tracked label', el, text); + if (!loud && (heading || size >= 24) && weight >= 800) add('Heavy heading', el, 'weight ' + weight + ': ' + text); + if (!loud && s.textTransform === 'uppercase' && size < 16 && px(s.letterSpacing) / size > 0.04 && text.length > 3) add('Uppercase tracked label', el, text); if (size < 16 && px(s.letterSpacing) < 0) add('Negative tracking on small text', el, 'letter-spacing ' + s.letterSpacing); if (EMOJI.test(text)) add('Emoji in the interface', el, text); if (/!/.test(text) && !/!=|!\\w+\\(/.test(text)) add('Exclamation mark', el, text); diff --git a/scripts/scaffold.mjs b/scripts/scaffold.mjs index 9074e80..32c70a0 100644 --- a/scripts/scaffold.mjs +++ b/scripts/scaffold.mjs @@ -5,6 +5,8 @@ // node scripts/scaffold.mjs [--kind base|landing|app] [--theme dark|light] [--palette ember] [--shape bowl] [--accent '#e8742c'] // [--seed 1] [--grain 0.45] [--hero stack|split|card] [--ground lit|flat|frame] [--art column] // +// voice base only, required: sans (Geist), grotesk (Bricolage Grotesque), serif (Newsreader, with italic) or +// condensed (Big Shoulders Display). weight is required with it: the headline's weight, 100 to 900. // kind base: type, buttons, colour, motion and fonts with no layout, for a page that composes its own frame from // its concept; landing (default): the whole standard page; app: a working surface with a sidebar, key numbers, // a chart, a table and an empty state @@ -176,10 +178,32 @@ export function scaffoldApp(dest, { theme = 'dark', accent } = {}) { return { dest, todo, problems: [], shape: 'app' }; } +// ---------- display voices for the base starter ---------- +// The face and weight are the page's own decision (references/direction.md), so the base has no default for either. +// Tracking per face and weight comes from measured letter gaps (evals/tracking.mjs): heavy type needs far less +// tightening than light type, and Newsreader takes none. Order: [h2, small display, 62rem, 80rem and up]. +export const VOICES = { + sans: { family: 'Geist', fallback: 'ui-sans-serif, system-ui, sans-serif', weights: [100, 900], files: [], light: [-0.02, -0.03, -0.03, -0.04], heavy: [0.01, 0, -0.01, -0.02] }, + grotesk: { family: 'Bricolage Grotesque', fallback: 'ui-sans-serif, system-ui, sans-serif', weights: [200, 800], files: ['bricolage.woff2'], licence: 'OFL-bricolage.txt', light: [-0.02, -0.03, -0.035, -0.04], heavy: [-0.01, -0.02, -0.02, -0.03] }, + serif: { family: 'Newsreader', fallback: '"Iowan Old Style", Georgia, serif', weights: [200, 800], files: ['newsreader.woff2', 'newsreader-italic.woff2'], licence: 'OFL-newsreader.txt', light: [0, 0.01, 0.01, 0], heavy: [0, 0.02, 0.02, 0.01] }, + condensed: { family: 'Big Shoulders Display', fallback: '"Arial Narrow", ui-sans-serif, sans-serif', weights: [100, 900], files: ['big-shoulders.woff2'], licence: 'OFL-big-shoulders.txt', light: [0, -0.02, -0.02, -0.03], heavy: [0.01, 0, 0, -0.01] }, +}; + +export function voiceCss(voice, weight) { + const v = VOICES[voice]; + const faces = v.files.map((file) => `@font-face { font-family: "${v.family}"; src: url("fonts/${file}") format("woff2"); font-weight: ${v.weights[0]} ${v.weights[1]}; font-style: ${file.includes('italic') ? 'italic' : 'normal'}; font-display: swap; }`); + const [h2, s, m, l] = weight > 500 ? v.heavy : v.light; + return `\n/* Display voice: ${voice}, ${weight}. Tracking measured for this face and weight. */\n${faces.join('\n')}\n:root {\n --display: "${v.family}", ${v.fallback};\n --display-weight: ${weight};\n --track-h2: ${h2}em;\n --track-1: ${s}em;\n --track-2: ${m}em;\n --track-3: ${l}em;\n}\n`; +} + // ---------- base starter: the craft without the layout ---------- // For a page whose frame comes from its own concept. No hero, no sections beyond the first and the last: the agent // composes the layout in page.css from the shape of the product's artifact (references/direction.md). -export function scaffoldBase(dest, { theme = 'dark', palette, accent } = {}) { +export function scaffoldBase(dest, { theme = 'dark', palette, accent, voice, weight } = {}) { + const how = 'Choose from the concept\'s voice line (references/direction.md).'; + if (!VOICES[voice]) throw new Error(`--voice is ${Object.keys(VOICES).join(', ')}${voice ? ` (got "${voice}")` : ''}. ${how}`); + const [low, high] = VOICES[voice].weights; + if (!Number.isInteger(weight) || weight < low || weight > high) throw new Error(`--weight for ${voice} is a number from ${low} to ${high}. ${how}`); if (accent && !/^#[0-9a-f]{6}$/i.test(accent)) throw new Error(`--accent is a six-digit hex colour (got "${accent}").`); const problems = []; let css; @@ -209,20 +233,22 @@ export function scaffoldBase(dest, { theme = 'dark', palette, accent } = {}) { mkdirSync(dest, { recursive: true }); writeFileSync(join(dest, 'index.html'), readFileSync(join(starter, 'index.html'), 'utf8').replace('data-theme="dark"', `data-theme="${theme}"`)); copyFileSync(join(starter, 'base.css'), join(dest, 'base.css')); - writeFileSync(join(dest, 'theme.css'), css); + writeFileSync(join(dest, 'theme.css'), css + voiceCss(voice, weight)); // Never overwrite the layout someone has already written. if (!existsSync(join(dest, 'page.css'))) writeFileSync(join(dest, 'page.css'), '/* Your layout. Take it from the shape of the product\'s own artifact. */\n'); copyFileSync(join(root, 'assets', 'motion', 'motion.css'), join(dest, 'motion.css')); copyFileSync(join(root, 'assets', 'motion', 'motion.js'), join(dest, 'motion.js')); cpSync(join(root, 'assets', 'fonts'), join(dest, 'fonts'), { recursive: true }); + const { files, licence } = VOICES[voice]; + for (const file of [...files, ...(licence ? [licence] : [])]) copyFileSync(join(root, 'assets', 'voices', file), join(dest, 'fonts', file)); const todo = (readFileSync(join(dest, 'index.html'), 'utf8').match(/data-todo/g) || []).length; - return { dest, todo, problems, shape: 'base', theme }; + return { dest, todo, problems, shape: 'base', theme, voice, weight }; } if (isMain(import.meta.url)) { const { positional, flags } = parseArgs(process.argv.slice(2), { booleans: ['motes', 'minimal'] }); if (!positional[0]) { - console.error("Usage: node scripts/scaffold.mjs [--theme dark|light] [--palette ember] [--shape bowl] [--accent '#e8742c'] [--seed 1] [--grain 0.45] [--hero stack|split|card] [--ground lit|flat|frame] [--art column] [--motes] [--minimal] [--kind base|app]"); + console.error("Usage: node scripts/scaffold.mjs [--theme dark|light] [--palette ember] [--shape bowl] [--accent '#e8742c'] [--seed 1] [--grain 0.45] [--hero stack|split|card] [--ground lit|flat|frame] [--art column] [--motes] [--minimal] [--kind app]\n node scripts/scaffold.mjs --kind base --voice sans|grotesk|serif|condensed --weight 400 [--theme dark|light] [--accent '#hex' | --palette name]"); process.exit(2); } try { @@ -230,7 +256,7 @@ if (isMain(import.meta.url)) { if (!['landing', 'app', 'base'].includes(kind)) throw new Error(`--kind is base, landing or app (got "${kind}").`); const text = (name) => (typeof flags[name] === 'string' ? flags[name] : undefined); const mode = flags.theme === 'light' ? 'light' : 'dark'; - const result = kind === 'app' ? scaffoldApp(positional[0], { theme: mode, accent: text('accent') }) : kind === 'base' ? scaffoldBase(positional[0], { theme: mode, accent: text('accent'), palette: text('palette') }) : scaffold(positional[0], { + const result = kind === 'app' ? scaffoldApp(positional[0], { theme: mode, accent: text('accent') }) : kind === 'base' ? scaffoldBase(positional[0], { theme: mode, accent: text('accent'), palette: text('palette'), voice: text('voice'), weight: flags.weight ? Number(flags.weight) : undefined }) : scaffold(positional[0], { theme: flags.theme === 'light' ? 'light' : 'dark', palette: typeof flags.palette === 'string' ? flags.palette : undefined, accent: typeof flags.accent === 'string' ? flags.accent : undefined, diff --git a/test/base.test.mjs b/test/base.test.mjs index c734af7..727d9e4 100644 --- a/test/base.test.mjs +++ b/test/base.test.mjs @@ -4,45 +4,48 @@ import { mkdtempSync, readFileSync, writeFileSync } from 'node:fs'; import { tmpdir } from 'node:os'; import { join } from 'node:path'; import { test } from 'node:test'; +import { fileURLToPath } from 'node:url'; import { measureTracking, tightestAt } from '../evals/tracking.mjs'; import { check } from '../scripts/check.mjs'; import { craft } from '../scripts/craft.mjs'; -import { scaffoldBase } from '../scripts/scaffold.mjs'; +import { VOICES, scaffoldBase } from '../scripts/scaffold.mjs'; +import { measure } from '../scripts/drift.mjs'; import { scan } from '../scripts/signs.mjs'; import { findChrome, launch, openPage, toUrl } from '../scripts/lib/chrome.mjs'; const skip = findChrome() ? false : 'no Chrome installed'; const folder = (name) => mkdtempSync(join(tmpdir(), `base-${name}-`)); +const plain = { voice: 'sans', weight: 400 }; const variants = [ - { name: 'dark', options: {} }, - { name: 'light', options: { theme: 'light' } }, - { name: 'cobalt', options: { palette: 'cobalt' } }, + { name: 'dark', options: { voice: 'sans', weight: 800 } }, + { name: 'light', options: { theme: 'light', voice: 'serif', weight: 400 } }, + { name: 'cobalt', options: { palette: 'cobalt', voice: 'condensed', weight: 900 } }, ]; test('the base starter ships no layout: no hero, no frame, an empty page.css that is never overwritten', () => { const dir = folder('files'); - scaffoldBase(dir); + scaffoldBase(dir, plain); const html = readFileSync(join(dir, 'index.html'), 'utf8'); for (const frame of ['class="hero', 'class="nav', 'class="window', 'class="bento', 'class="steps', 'class="closer']) assert.ok(!html.includes(frame), `${frame} is part of the shared frame`); writeFileSync(join(dir, 'page.css'), '.mine {}\n'); - scaffoldBase(dir); + scaffoldBase(dir, plain); assert.equal(readFileSync(join(dir, 'page.css'), 'utf8'), '.mine {}\n'); }); test('a flat tone sets the theme, and an unknown palette is refused', () => { - assert.equal(scaffoldBase(folder('sand'), { palette: 'sand' }).theme, 'light'); - assert.throws(() => scaffoldBase(folder('bad'), { palette: 'nope' }), /Unknown palette/); + assert.equal(scaffoldBase(folder('sand'), { ...plain, palette: 'sand' }).theme, 'light'); + assert.throws(() => scaffoldBase(folder('bad'), { ...plain, palette: 'nope' }), /Unknown palette/); }); test('the accent asked for is the accent written, with readable text on it, and a faint one is reported', () => { const dir = folder('accent'); - const strong = scaffoldBase(dir, { theme: 'light', accent: '#b0271c' }); + const strong = scaffoldBase(dir, { ...plain, theme: 'light', accent: '#b0271c' }); const css = readFileSync(join(dir, 'theme.css'), 'utf8'); assert.match(css, /--accent: #b0271c;/); assert.match(css, /--on-accent: #ffffff;/); assert.deepEqual(strong.problems, []); - assert.match(scaffoldBase(folder('faint'), { theme: 'light', accent: '#ffd43b' }).problems[0], /too faint/); - assert.throws(() => scaffoldBase(folder('short'), { accent: 'red' }), /hex/); + assert.match(scaffoldBase(folder('faint'), { ...plain, theme: 'light', accent: '#ffd43b' }).problems[0], /too faint/); + assert.throws(() => scaffoldBase(folder('short'), { ...plain, accent: 'red' }), /hex/); }); test('the base sets no layout a page has to fight: its two blocks carry no specificity', () => { @@ -69,22 +72,58 @@ for (const { name, options } of variants) { }); } -test('the base type never sets tighter than the measured evidence allows, and nothing overflows', { skip }, async () => { - const rows = await measureTracking({ font: 'Geist' }); - const dir = folder('type'); - scaffoldBase(dir); - const chrome = await launch(); - try { - for (const width of [320, 390, 768, 1024, 1440, 2560]) { - const page = await openPage(chrome.browser, { width, height: 900, mobile: width < 700 }); - await page.goto(toUrl(join(dir, 'index.html')), 600); - assert.equal(await page.evaluate('document.documentElement.scrollWidth <= document.documentElement.clientWidth + 1'), true, `${width}px scrolls sideways`); - for (const [sel, size, em] of await page.evaluate(`['.display', '.h2'].map((sel) => { const s = getComputedStyle(document.querySelector(sel)); const size = parseFloat(s.fontSize); return [sel, size, s.letterSpacing === 'normal' ? 0 : parseFloat(s.letterSpacing) / size]; })`)) { - const limit = tightestAt(rows, size); - assert.ok(em >= limit - 0.0051, `${width}px: ${sel} is ${size}px at ${em.toFixed(3)}em; the evidence allows ${limit}em`); - } - assert.deepEqual(page.logs, [], `${width}px console errors`); - await page.close(); - } - } finally { await chrome.close(); } +test('the face and weight have no default, and an impossible one is refused', () => { + assert.throws(() => scaffoldBase(folder('none')), /--voice is/); + assert.throws(() => scaffoldBase(folder('noweight'), { voice: 'serif' }), /--weight for serif/); + assert.throws(() => scaffoldBase(folder('heavy'), { voice: 'grotesk', weight: 900 }), /200 to 800/); }); + +test('the base carries no house furniture: no arrow, no mono captions, no dimmed second line', () => { + const dir = folder('furniture'); + scaffoldBase(dir, plain); + const page = readFileSync(join(dir, 'index.html'), 'utf8'); + const css = readFileSync(join(dir, 'base.css'), 'utf8'); + assert.ok(!page.includes('m-arrow') && !page.includes(' dim')); + assert.ok(!css.includes('var(--mono)')); + assert.match(page, /data-mode="persuade"/); +}); + +test('a persuading page may use a heavy headline and tracked capitals; a working screen may not', { skip }, async () => { + const loud = fileURLToPath(new URL('./fixtures/loud-persuade.html', import.meta.url)); + assert.deepEqual(await scan(loud), []); + assert.ok(!(await measure(loud)).flags.some((f) => /heavy/.test(f))); + const working = join(folder('working'), 'p.html'); + writeFileSync(working, readFileSync(loud, 'utf8').replace(' data-mode="persuade"', '')); + assert.deepEqual([...new Set((await scan(working)).map((f) => f.tell))].sort(), ['Heavy heading', 'Uppercase tracked label']); + assert.ok((await measure(working)).flags.some((f) => /heavy/.test(f))); +}); + +for (const voice of Object.keys(VOICES)) { + const { family, weights: [low, high], files } = VOICES[voice]; + for (const weight of [...new Set([Math.max(low, 400), Math.min(high, 900)])]) { + test(`${voice} ${weight}: the face loads, and no size is set tighter than its measured evidence allows`, { skip }, async () => { + const css = fileURLToPath(new URL(files.length ? '../assets/voices/voices.css' : '../assets/fonts/fonts.css', import.meta.url)); + const rows = await measureTracking({ font: family, weight, fontsCss: css }); + const dir = folder(`${voice}-${weight}`); + scaffoldBase(dir, { voice, weight }); + const chrome = await launch(); + try { + for (const width of [320, 390, 768, 1024, 1440, 2560]) { + const page = await openPage(chrome.browser, { width, height: 900, mobile: width < 700 }); + await page.goto(toUrl(join(dir, 'index.html')), 600); + assert.equal(await page.evaluate('document.documentElement.scrollWidth <= document.documentElement.clientWidth + 1'), true, `${width}px scrolls sideways`); + assert.equal(await page.evaluate(`document.fonts.check('${weight} 40px "${family}"')`), true, `${family} loaded`); + for (const [sel, size, em] of await page.evaluate(`['.display', '.h2'].map((sel) => { const s = getComputedStyle(document.querySelector(sel)); const size = parseFloat(s.fontSize); return [sel, size, s.letterSpacing === 'normal' ? 0 : parseFloat(s.letterSpacing) / size]; })`)) { + // Newsreader's own letters sit closer than the 2 px rule at every tracking, so it is held to "never tighter than zero". + const limit = voice === 'serif' ? 0 : tightestAt(rows, size); + assert.ok(em >= limit - 0.0051, `${width}px: ${sel} is ${size}px at ${em.toFixed(3)}em; the evidence allows ${limit}em`); + } + const gaps = await page.evaluate("[...document.querySelectorAll('.first > * + *, .last > * + *')].map((el) => el.getBoundingClientRect().top - el.previousElementSibling.getBoundingClientRect().bottom)"); + assert.ok(gaps.length >= 3 && gaps.every((g) => g >= 16), `${width}px: stacked blocks keep their space (${gaps.map(Math.round)})`); + assert.deepEqual(page.logs, [], `${width}px console errors`); + await page.close(); + } + } finally { await chrome.close(); } + }); + } +} diff --git a/test/fixtures/loud-persuade.html b/test/fixtures/loud-persuade.html new file mode 100644 index 0000000..ee88111 --- /dev/null +++ b/test/fixtures/loud-persuade.html @@ -0,0 +1,6 @@ + + +Example: a loud headline + +

Example tide station

High water now

Example text.

+