Introduction
Laws
9 laws that hold across every repo. They are deliberately written as constraints rather than preferences: a constraint can be checked in review, and it travels to a new codebase without me having to be in the room.
- 01
Mono for structure, sans for prose.
Uppercase mono kickers at 11px/0.18em tracking label every section. Body copy is font-light sans with generous leading. The contrast between the two carries the hierarchy, so headings rarely need to be big. Sizes come from one closed scale, eight pixel steps and a display size, and nothing off it.
The style checkSizes are text-10 to text-20 and text-display. The check reports an arbitrary pixel or clamp size, which is a size the scale does not have.
- 02
One accent, used sparingly.
Everything is greyscale on a near-black (or near-white) ground except a single quiet green. If two things on screen are competing for the accent, neither gets it. The five-hue accent set belongs to the art layer, not the interface; the one place it reaches the chrome is where hue is the value rather than decoration on one, as in the deck’s position pill.
The style checkOutside globals.css the check reports a hex value, any colour function, and stock white or black: every surface has to resolve from a variable.
- 03
Light falls, nothing casts.
Depth is a 1px edge and a graded fill, never a drop shadow. A raised card grades light-to-dark downward and lifts its top edge; a recessed well inverts both. Fine grain over the fill keeps a gradient this shallow from banding. Rounded to 0.75rem for cards, 0.5rem for controls.
The style checkThe check reports every shadow utility, a bare shadow in a class string, a box shadow in CSS and a drop shadow filter.
- 04
Motion moves space, never brightness.
Animation translates, scales, and displaces. It does not flash, strobe, or pulse opacity. This started as an accessibility rule for the audio-reactive work and became the house style.
The style checkThe check reports the pulse and ping animations, keyframes that animate only opacity or filter, and a hover that dims.
- 05
Loops pause when unwatched.
Every canvas engine gates its RAF loop on an IntersectionObserver plus visibilitychange, and renders one still frame under prefers-reduced-motion. Ambient animation should cost nothing when nobody is looking.
The style checkA file that calls requestAnimationFrame must also carry an IntersectionObserver, a visibilitychange gate and a reduced-motion branch, or be listed in the check with the reason it is not a loop.
- 06
Layout never jumps.
Tabbed regions are floored to the tallest tab at each breakpoint. Images ship with intrinsic dimensions and blur placeholders. Switching views should never move the content under a reader.
The style checkEvery Image and img ships a width and a height, or fill, or a static import that carries its own size.
- 07
Server by default.
Components stay server-rendered unless they need state, an event, or a canvas. The client boundary is drawn as deep in the tree as possible: a card is a server component even when its page is interactive.
The style checkCLIENT_BUDGET in the check is the count of client files. Spending one means raising it in the same commit, with the reason in that commit.
- 08
Per-frame state lives in the DOM.
Anything changing at sixty frames a second is written straight to a CSS variable or a data attribute and React is never told; React state is for what changes at human speed. The projects deck scrolls eighteen covers for zero re-renders, because its position is one custom property the CSS reads and every cover derives its own pose from it.
JudgementNo tool can see it, so it is held by hand: anything scroll-linked or animated writes a CSS variable or a data attribute, never React state. The deck (cover-flow.tsx) and the reveal (reveal.tsx) are the two worked examples.
- 09
Every ink clears its ground.
Text is never mixed below the point where it reads at 4.5:1 on the page in both themes: the foreground stops at 60 percent, the muted ink and ink on art at 75. The quiet register is that floor, and hierarchy under it is size, case and tracking, which law 01 already gives. The check computes the floors from the tokens, and the sweep reads every page back through axe to prove them.
The sweepThe check computes each ink’s floor from the tokens and reports a text modifier or a stylesheet mix under it; the sweep then reads every page back through axe at both widths in both themes, which is the law as rendered.
How they are held
A constraint nothing checks is a preference, so every law but one has a tool behind it.
The style check
npm run style:check
Reads the source before every build and reports a law broken in it. A self-test proves each rule still fires on a fixture that must trip it.
The sweep
npm run site:sweep
Drives every built page through Chrome at 1280 and 375 in both themes and runs axe over it: the laws as rendered.
Judgement
law 08
Where state lives is not visible in a file. It is held by hand, against the two worked examples.
Where the laws stop. They govern the interface, not every pixel on it. The canvas engines, the shaders, the transcribed logo masters and the write-ups that embed another product carry their own colours, and are listed in the check as art with the reason beside each. A theme switch must not recolour Prospect Park, or somebody else's app.