Design Conventions

How the browser tools on this site are built, why they ended up that way, and what went wrong along the way.

This site hosts a few dozen interactive tools. They grew over several months, mostly written with a coding assistant. The style below was not designed up front. It accumulated, was wrong several times, and settled into a small set of shared components once the cost of per-tool variants became clear. This page covers the stack, the color system, the components, and the specific mistakes each rule exists to prevent.

The page describes; it does not prescribe. The reasons behind each convention are the part that transfers to other projects. A value copied without its reason is right in one theme and wrong in the other two. That happened here repeatedly.

The three files that carry the system

For the single-file no-build stack there are also /assets/js/react.production.min.js, /assets/js/react-dom.production.min.js and /assets/js/htm.js, all vendored locally.

These files are meant to be copied into a project. Hot-linking them is a bad idea: this is a personal site with no CDN guarantees, and the files change.

Every page under /miscellaneous/tools/ is a worked example with readable source. There is no build step, so the file in the browser is the file that runs.

Roughly the second half of custom.css is specific to this site: the per-section color schemes, the breadcrumb header, the wordmark, the view-transition animations for theme and language switching, the landing page accordion. The first half generalizes to any small web app: the color ladder, the components, and the reasoning that decides which component a given control is.

1. The stack, and why one file

One .html file per tool. React 18 and htm from local <script> tags, no bundler, no package manager, no npm, no CDN request of any kind. The app renders into <div id="root">. Where a tool needs data, it fetches static JSON next to the page.

The single file started as a constraint of GitHub Pages. It became the most useful property of the whole setup. A tool is one artifact: it can be emailed, dropped on a network share or opened from a USB stick. Nothing has to resolve, so it still works years later. On a locked-down network there is no proxy to negotiate with, no registry, no allowlist and no supply chain. The single file has a real cost as well; the next section covers it.

Self-containment has one exception. Logic that a second tool needs becomes a shared module with its own test. Copies drift, and the drift is always found long after the copy was made.

Each file has two named script blocks. The app block holds the React component tree. The real logic (the math, the parsing, the geometry) sits above it in a separate block. That block's id ends in core, abbreviated per tool: erocore, ebookcore, lambdacore. It holds pure functions: no markup, no DOM access. The Node tests hang on this block. A test reads the HTML file, pulls the block out by its id and evaluates it, with no browser and no rendering.

The skeleton, minus this site's own chrome:

<!doctype html>
<html lang="en" data-theme="dark">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>…</title>
  <link rel="stylesheet" href="assets/pico.min.css">
  <link rel="stylesheet" href="assets/custom.css">
</head>
<body>
  <main class="container"><div id="root"></div></main>

  <script src="assets/react.production.min.js"></script>
  <script src="assets/react-dom.production.min.js"></script>
  <script src="assets/htm.js"></script>
  <script src="assets/icons.js"></script>

  <!-- Pure functions, no markup, no DOM. This block is the seam that makes the
       tool testable from Node: a test reads the file, pulls the block out by id
       and evaluates it. Renaming the id, or folding the code into the app block,
       breaks the tests with an unhelpful "no block found". -->
  <script id="xycore">
    function computeSomething(a, b) { … }
  </script>

  <script id="app">
    const html = htm.bind(React.createElement);
    const { useState, useMemo } = React;

    function App() {
      return html`<h1>…</h1>`;
    }
    ReactDOM.createRoot(document.getElementById('root')).render(html`<${App} />`);
  </script>
</body>
</html>

The core block is useful even without a test suite. It keeps the math apart from the DOM. A function that needs the DOM to run cannot be checked by reading it or by a script.

2. htm instead of JSX: the trade, the traps, the checker

Until August 2026 every tool loaded babel.min.js (3.0 MB) and compiled its JSX in the visitor's browser on every page load. There is no build step to do it earlier. htm (1.3 kB, MIT) replaced Babel. With htm, the markup is written as tagged template literals. Tagged template literals are valid JavaScript, and the browser runs them directly. All 36 tools were converted in one campaign, and Babel was deleted.

The gains, recorded here so they are not traded away later:

The single line at the top of every app block: const html = htm.bind(React.createElement);

The traps, all verified against the vendored copy

htm itself never throws. A mistake silently produces a different tree. The two loud failures in the list come from elsewhere: React rejects a string style (item 1), and the JavaScript parser catches one typo (item 11). Silent failure is the expensive half of the trade. A coding assistant makes it worse: models are trained mostly on JSX and reach for JSX spellings by reflex. Every item below is a bug that shipped here at least once.

  1. style must be an object. style=${{ marginBottom: 14 }}. A string throws React error #62 at render time. The result is a blank page with a minified error number and no other clue. This trap costs an hour every time.
  2. Attribute names stay React names: className, htmlFor, strokeWidth. htm passes props to React.createElement untouched and maps no HTML names to React names. class= and for= therefore fail silently.
  3. ${…}, not {…}. A forgotten $ turns an interpolation into literal text, or into an attribute holding a braces string. No warning.
  4. <> is not a fragment. htm reads it as a tag with an empty name and hands "" to createElement. The fragment is <${React.Fragment}>…<//>.
  5. Void elements need closing. <div>a<br>b</div> parses as a div containing "a" and a br. The br swallows "b" and everything after it, including the div's own closing tag.
  6. HTML entities are not decoded. Babel decoded &times; and &nbsp; in JSX text. htm passes the literal characters through, and the page shows the entity. The tools here use the character itself instead, or a \u escape inside an interpolation.
  7. Comments are <!-- … -->. JSX comment syntax inside a template renders as text.
  8. A missing closing tag silently nests the following siblings inside the open element. Also no warning.
  9. Multiple roots return an array. htm builds no fragment, and React then wants keys on the array. Deliberate multi-root templates get wrapped in React.Fragment.
  10. Every nested template needs its own html tag. A bare backtick string inside ${…} becomes text.
  11. The one typo that is caught, but misreported: <//>} instead of <//>`}. The missing backtick closes a nested template; it belongs before the brace that closes the interpolation. Two agents converting different tools made this typo independently. It is a syntax error. V8 reports it as "Missing } in template expression" and points at the outer template's line. Bisecting with a standalone vm.Script parse finds the real spot.

The conversion table used during the migration:

JSX                              htm
return ( <div…> )                return html`<div…>`
{value}                          ${value}
attr={value}                     attr=${value}
attr="literal"                   attr="literal"   (unchanged)
{items.map(x => ( <li…> ))}      ${items.map(x => html`<li…>`)}
{cond && <p/>}                   ${cond && html`<p/>`}
{/* note */}                     <!-- note -->
<>…</>                           <${React.Fragment}>…<//>
<Comp x={1}/>                    <${Comp} x=${1}/>
{' '}                            ${' '}
{...props}                       ...${props}

key and ref are ordinary props to htm and get picked out by createElement exactly as with JSX.

The checker, which is the part worth stealing

Silent failure needs a mechanical check. The migration ran against one. For each tool, the unconverted version stayed in git HEAD and the new version stayed unstaged. The checker pulls the old JSX out of git and compiles it with Babel. It runs the new htm source against the same stub React. Then it diffs the two element trees, which have to be byte-identical. The order was convert, check, commit, one tool per commit. A regression is therefore one git revert.

A tree comparison at initial state proves almost nothing. Every conditional branch, tooltip and modal stays unrendered there. Each tool therefore has a scenario table with injected useState values. Five lessons about that table came the hard way:

Two rules around the checker mattered more than its code. First, the checker is never weakened to reach a green result. A diff is a fault in the tool, never in the checker. Scenarios get added, never defanged. Second, a conversion contains no reformatting and no drive-by improvements. A pre-existing bug found on the way gets reported, then fixed afterwards in its own commit. The equivalence check only proves the tree is unchanged. It cannot tell an intentional improvement from a mistake, and a diff that mixes both is unreviewable.

Node proves the tree. It does not prove the rendering. Every conversion was therefore followed by a browser pass: the page renders at all (blank means broken), the console shows no React warnings, every interactive control works, the live language switch and the live theme switch work, and any canvas or SVG redraws on the theme event.

The repo keeps this material as a Claude Code skill, .claude/skills/jsx-to-htm/SKILL.md. A session that hits an htm bug finds it there without being told. The equivalent place for GitHub Copilot is .github/copilot-instructions.md, or a scoped .github/instructions/htm.instructions.md. The trap list above is the valuable part. The rest is bookkeeping specific to this repo.

htm has a real cost: no editor support inside the markup. That means no highlighting, no type checking, no linting and no rename across the file. htm is the right choice where the single file is worth more than that tooling. Where a build step is allowed and the tooling matters more than shipping one artifact, JSX and Vite are the better answer.

File size turned out not to matter, which was a surprise. The largest tool here is just over 10,000 lines in one file. The next two are 8,500 and 7,400 lines. All three are htm without a build step, and the line count never hurt. The pressure came from the trap list above and from the absence of module boundaries.

3. Color: a ladder of roles, three skins

The site has three skins: light, dark and grey. The choice lives in data-skin on <html>. Its polarity lives in data-theme. Grey is therefore a dark skin: it inherits the dark rules and then overrides them. Grey tells elements apart by outline instead of fill. Page and panels are the same gray, there are no shadows, and there is one single accent. Grey turned out to be the most useful skin. It exposes every place where color was doing work that structure should have done.

No tool writes a gray or a border color as a hex value. Each tool uses a rung of a ladder, named by role, and gets all three skins for free. The dark values are constructed in OKLab: hue 250°, even lightness steps, chroma rising toward the dark end. Three rungs leave the even steps to meet a contrast floor. Every text rung reaches 4.5:1 against the tool surfaces, and the border rung reaches 3:1. The light and grey sets keep the roles and change the numbers. All values are generated, not picked by eye. The table below therefore gives only the dark rungs. The light and grey counterparts live in custom.css under the same names. A copy here would be a second copy to keep in sync.

VariableRoleDark
--tool-emphemphasized text, card titles#e1e8f0
--tool-textbody text, h1#bcc5cf
--tool-labellabels, secondary text#99a4af
--tool-notefootnotes, meta text#8d9aa7
--tool-faintdisclaimers#808f9f
--tool-borderframes, button outlines#68798a
--tool-hairlineseparators inside a panel#1a2a3a
--tool-gridchart grid lines, plot frames#45596d
--tool-surfacecard and plot background#111c28
--tool-panelpanel and popover surface#0a1928
--tool-inkdark text on a light chip#0a1928

Two rungs that look identical in dark, --tool-ink and --tool-panel, are separate on purpose. In the grey skin the panel takes the page color, while chip text still has to be dark. Two roles that share a value in one theme are still two roles, and another theme will pull them apart.

On top of the ladder sit four callout groups, each with -bg, -border and -text (--tool-ok-*, --tool-warn-*, --tool-info-*, --tool-danger-*), four signal colors for readouts and plot marks (--tool-sig-good, -warn, -bad, -info) and --tool-shield-* for the privacy badge. The light signals sit two steps darker than the dark ones. A Tailwind-400 green on white is a pastel nobody can read.

Canvas and WebGL have to be told

CSS variables reach the DOM. They do not reach a canvas. Some tools bake palette values into JavaScript. Those tools read the values once through a readPalette() into mutable bindings. When the theme changes, they re-read the values and redraw:

function readPalette() {
  const cs = getComputedStyle(document.documentElement);
  return { text: cs.getPropertyValue('--tool-text').trim(), … };
}
let PAL = readPalette();
window.addEventListener('themechange', () => { PAL = readPalette(); redraw(); });

themechange is a custom event fired by this site's own switcher. Elsewhere a MutationObserver on data-theme does the same job. Eight tools here need the redraw. A missing redraw looks like a rendering bug that appears only after a theme switch.

Some fills are computed from data instead of themed, such as heatmap cells. On those, the text color is picked by luminance: dark #1e293b above 145, light #f1f5f9 below. These two colors are inputs to a calculation and stay literals.

Colormaps

Colormaps come in two families. The data decides which one a tool takes. A diverging map is for a signed quantity with a meaningful zero. There, the question is which side of the middle a value falls on. A sequential map is for a quantity that only goes up. There, the middle means nothing, and a diverging map would spend its strongest contrast on a meaningless middle.

The diverging maps are the shared convention: three RGB triples, interpolated linearly. hollywood is the default, named after the orange-and-teal film grade it comes from. No single default serves everyone, so there are alternatives: greyscale for printing, tritanopia for blue-yellow color blindness, and the ColorBrewer scales for readers who already know them.

hollywood:  { neg: [255,140,66],  mid: [245,245,245], pos: [0,139,139]  }   // default
greyscale:  { neg: [0,0,0],       mid: [128,128,128], pos: [255,255,255] }
tritanopia: { neg: [200,85,61],   mid: [245,245,245], pos: [74,172,143] }
rdbu:       { neg: [33,102,172],  mid: [247,247,247], pos: [178,24,43]  }
rdylgn:     { neg: [215,48,39],   mid: [255,255,191], pos: [26,152,80]  }
spectral:   { neg: [213,62,79],   mid: [255,255,191], pos: [50,136,189] }
puor:       { neg: [230,97,1],    mid: [247,247,247], pos: [94,60,153]  }
brbg:       { neg: [140,81,10],   mid: [245,245,245], pos: [1,102,94]   }

The sequential maps are not shared. They need more resolution than three stops, and only two tools have data of that shape. The sun-hours map offers viridis, plasma, inferno, magma and four older matplotlib ramps. Each is sampled at nine evenly spaced points and interpolated in between. Next to them sits one hand-built ramp that puts its yellow late. A fully sunlit courtyard is the exception in the data, so the yellow is reserved for the top of the range. The wave tool samples at eleven points. For two of its maps, eleven points is exactly the published anchor list, and nothing is approximated at all.

These ramps are trustworthy because none was written from memory. The numbers were read out of matplotlib 3.11. A ramp typed from memory differs from the ramp it claims to be, and nobody can tell by looking.

Most of these maps are other people's work. rdbu, rdylgn, spectral, puor and brbg are ColorBrewer diverging schemes. They are the cartographic work of Cynthia Brewer at Penn State, taken here in the form matplotlib ships under the same names. Their color specifications are published for reuse under an Apache-style license. Using them is a matter of attribution; the license permits it.

On the sequential side, Nathaniel Smith and Stéfan van der Walt designed viridis, plasma, inferno and magma for matplotlib and released them into the public domain. The older ramps beside them are matplotlib's, with a longer history. The wave tool also uses Managua from Fabio Crameri's scientific colour maps. Managua is dark in the middle: still water reads dark, crests and troughs both read light.

Four maps are local to this site: hollywood, greyscale, tritanopia, and the hand-built sun ramp. Nobody else is responsible for them.

The table above hides one loss. A ColorBrewer scheme is specified at more than three stops. Sampling it down to a negative end, a middle and a positive end, then interpolating linearly, throws away most of its perceptual design. The hue pairing and the neutral midpoint survive, and those are the parts these tools use. A genuinely uniform ramp needs the full stop list, or a perceptual map such as viridis.

Colormaps are the one part of the color system outside the ladder. They do not switch with the skin, because they encode data. A scale that changed meaning on a theme switch would make a different chart.

Colormaps are also the one place where centralizing was tried and abandoned. The plan was a single map set for the whole site, on the same reasoning that produced one button and one segmented control. The plan failed because what looks good depends on what is drawn. A sauce comparison table, a moving wave field and a map of annual sunlight hours want different ramps. One set for all three made each slightly worse, for a consistency nobody would notice. Code is shared across the site; colormap choice stays with each tool.

4. The components

Everything in this section is defined once, centrally. The most expensive habit on this site was a tool inventing its own version of a control that already existed. An audit in August 2026 found roughly eighteen distinct size sets for the ordinary button. It also found nine files carrying a byte-identical rule body under nine different names. Consolidating them took a week. A shared class from the start would have avoided that week entirely.

Action buttons

Live, and restyled by the theme switcher above

Rain intensity
<button type="button" class="tool-btn">Download</button>
<button type="button" class="tool-btn tool-btn-sm">Copy</button>
<button type="button" class="tool-btn tool-btn-primary">Generate</button>
<button type="button" class="tool-danger">Reset everything</button>
<button type="button" class="tool-danger tool-btn-sm">Remove</button>
<button type="button" class="tool-linkbtn">show 40 more</button>

Icons

ToolIcons.el(name, props) returns a React element, ToolIcons.html(name, size) the same icon as a string. Inline SVG, 14 px, fill: none, stroke: currentColor, width 2, round caps. Available: download upload copy reset remove play pause check plus external link search tune text dice pipette merge.

With currentColor, the icon takes the button's text color in every skin and in the hover and disabled states. No extra CSS rule is needed.

Three conventions govern the icons. All three are about restraint:

Text fields, and Pico's specificity trap

Live

Pico's rule is input:not([type=checkbox],[type=radio],[type=range]). It puts a fixed height on the element. Pico computes that height from 1rem, not from the element's own font size. With Pico's defaults and its root scaling above 1280 px, the field is 62 px tall. The button beside it is 41 px. A field half again as tall as its neighbor looks wrong on the page. Four tools fell into the traps that follow:

The shared classes are .tool-input, .tool-input-sm and .tool-input-inline. .tool-input-inline releases the width from Pico's 100%, for a field in a chip row instead of a label grid. The geometry of all three matches .tool-btn exactly, and a field and the button next to it line up to the pixel. Background, focus ring and validity states stay Pico's. A field therefore still reads as something to type into.

Tabs choose a VIEW, segmented controls choose a SETTING

Both components exist for this distinction. A view switch built as a segmented control looked exactly like the half dozen settings underneath it. The choice that decides what the page shows then read as one option among many. Underlined tabs say "these are the sections".

Live: tabstrip, joined seg-row with a disabled segment, gapped chip row

<div class="tabstrip" role="tablist">
  <button role="tab" class="active">Chart</button>
  <button role="tab">Table</button>
</div>

<div class="seg-row">
  <button class="lang-seg active">Before</button><button class="lang-seg">After</button>
</div>

Tabs take no class per button, only role="tab" and active. Margins stay with the page. The strip sits at a different distance from its neighbors on every page.

Segments are .lang-seg. The name is historical: the class serves every segmented control, beyond the language switcher. Corners follow DOM adjacency, keyed on :has(+ .lang-seg) and + .lang-seg. The earlier version keyed on :first-child and :last-child. That only held when the segments were the sole flush children of their wrapper. A lone button came out rounded on the right only, and half a dozen tools carried a local patch for it. With adjacency, a lone button needs no patch, and a group still joins seamlessly.

Every segment keeps all four of its own borders. The row overlaps neighboring borders by margin-left: -1px, and z-index raises the active, hover and focus states. Before that, the left neighbor handed over its seam with border-right: none. That approach broke twice:

The new geometry has a cost. Squared corners and overlap are the default for adjacent segments, and adjacency cannot see a gap. Some gapped rows hold separate actions instead of one control. Such a row opts out with two declarations on its own row class:

.qr-chips > .lang-seg { border-radius: 4px; margin-left: 0; }

There is deliberately no shared .chip-row. Each such row needs a class of its own for gap and sizing anyway. An earlier failure shaped this decision: .seg-row was referenced in comments for two weeks and never actually defined. Seventeen tools hand-rolled it in three mutually incompatible geometries. A class named in comments but never defined did more harm than no name at all.

Info folds

Live

How this is calculated

The body is indented behind a hairline and set slightly smaller and muted. No border, no background, no box: a fold holds prose a reader may skip, so it must not look like an object.

<details class="fold">
  <summary>How this is calculated</summary>
  <div class="fold-body"><p>…</p></div>
</details>

The fold-body wrapper is mandatory: the hairline hangs on it. Folds carry no local chevron or marker CSS. The paragraphs inside carry no inline colors or font sizes, because fold-body already styles them. fold-sm is the compact variant for dense result areas.

The fold is for prose only. Functional disclosures kept their own designs: control sections, edit panels with forms, advanced-option panels, popovers, show-more links, list accordions. The native <details> replaced every React "show notes" toggle on the site. A <details> prints, the browser's own search finds its text, and it needs no state.

The control card

The control card is for tools whose parameters form groups. One card holds all the groups. Hairlines separate the groups inside it; no group gets a box of its own.

Live

Rainfallper iteration

Advanced

Sediment

<div class="ctl-card">
  <div class="ctl-sec">…fields…</div>
  <div class="ctl-sec">
    <p class="ctl-sec-h">Group<span class="ctl-sec-h-sub">aside</span></p>
    <div class="ctl-group"><p class="ctl-group-h">Subgroup</p> … </div>
  </div>
  <div class="ctl-sec"><details class="ctl-adv"><summary>Advanced</summary> … </details></div>
</div>

What went wrong on the way to this design:

The dual slider

Two handles on one track, for the two ends of one quantity: a daily minimum and maximum, a rank from and to, a year range. Two [type=range] inputs lie on top of each other, with their own rendering zeroed out. The visible parts are .dual-track, .dual-fill and two .dual-dot spans.

Live

Range 25 to 70

<div class="dual-range">
  <div class="dual-track"><div class="dual-fill"></div></div>
  <input class="dual-thumb" type="range" …><span class="dual-dot"></span>
  <input class="dual-thumb" type="range" …><span class="dual-dot"></span>
</div>

The dual slider takes Pico's --pico-range-* variables and has no values of its own. Three tools use it, and in all three it stands directly next to ordinary single sliders. It has to look like them in every skin. Before it was shared, it existed three times, with three different hardcoded accent colors.

Four details are load-bearing. Each was a bug once:

Three things stay with the tool: its own margins; --dual-ring, if the slider sits on a card instead of the page surface; and the z-index swap that brings the lower handle forward once the two handles are close together. Without the swap, the handle at the stop can no longer be grabbed. The swap depends on the tool's step size.

Frames, and the opposite of a frame

Anything that shows something (an SVG plot, a canvas, an image preview, a parameter map) sits in the same frame. The frame is border, radius and shadow:

border: 1px solid var(--tool-border);
border-radius: 8px;
box-shadow: var(--tool-panel-shadow);

The background is not part of the frame. A surface keeps its own background where it has one: a checkerboard for transparency, a gradient, a 3D scene. Rounded corners over canvas content need overflow: hidden on the container. The frame belongs on the element inside a scroll wrapper. A frame on the wrapper itself scrolls out of view when the content is panned sideways.

A drop zone is the opposite affordance and deliberately looks unlike a frame: 2px dashed var(--pico-muted-border-color), border-radius: 12px. The dashed border invites a drop; it marks an empty slot. One tool switches from the dashed zone to the plot frame the moment an image is loaded.

The privacy badge

Live

Everything stays in your browser. Nothing is uploaded.

<p class="tool-shield">
  <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
       stroke-linecap="round" stroke-linejoin="round" style="flex-shrink:0" aria-hidden="true">
    <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
  </svg>
  Everything stays in your browser. Nothing is uploaded.
</p>

The shield glyph is part of the badge. The class is an inline-flex with a gap and expects the icon as its first child. The shield is the one icon missing from icons.js. It sits inline in every tool that carries the badge. That is a small inconsistency in this repo, not a convention.

The badge has one fixed place: no inline margin, directly below the description text, above everything else. In an earlier phase it sat next to whatever triggered it: over the drop zone in one tool, over the salary fields in another, over the microphone button in a third. Each placement was defensible on its own. Together they were incoherent.

The badge is reserved for genuinely sensitive personal data: a due date, medication, a voice recording, a salary. It had spread to five tools that merely accepted an image file. The spread was called inflationary, and the badge was removed from all five on the same day. A reassurance on every page reassures nobody.

The category accordion

The landing page groups its entries in native <details> elements, with no JavaScript at all. The accordion is the browser's own disclosure, restyled. Each group is a card. The native marker and Pico's own chevron are both removed. A custom chevron sits on the left of the summary. A marker at the far right of a full-width card loses its connection to the label. The group id doubles as the deep-link anchor.

<details class="tool-group" id="3d-modelling">
  <summary>
    <span class="tool-group-icon" style="--icon:url('/assets/img/icons/box.svg')" aria-hidden="true"></span>
    <span class="tool-group-label">3D Modeling <span class="tool-group-count">(3)</span></span>
  </summary>
  <ul class="tool-list">
    <li><span class="tool-icon" style="--icon:url('icons/mountain.svg')"></span>
      <span class="tool-text"><a href="…">Heightmap to STL</a>
        <span class="tool-desc">…</span></span></li>
  </ul>
</details>

The sample above is abridged. The real summary also carries a copy-the-permalink button that appears on hover. A search field above the list filters the whole list live.

The group icons are SVG masks, not <img> elements. An --icon variable supplies each mask, and the mask is tinted like text. The icons therefore follow the theme the way text does, the same idea as currentColor in the button icons.

5. Layout and width

Wordmark, content and footer line up on one vertical edge, left and right. The alignment is not automatic. Each page has to keep it. Eleven pages here were misaligned until a script checked it.

Pico steps .container at 510 / 700 / 950 / 1200 / 1450 px, switching at 576 / 768 / 1024 / 1280 / 1536 px of window width. A page that renders into a plain .container gets the same step for header, content and footer for free. Most pages here do that, and none of them has ever had an alignment problem.

A page that sets its own width has to cap the header and footer at the same width. Otherwise the wordmark lands inside the content edge at some window widths and outside it at others. Two shapes exist here:

/* wrapper with padding:16px around an inner box of max-width:N */
header.container, body > footer.container { max-width: calc(N + 32px); padding: 0 16px; }

/* root IS a .container with an inline maxWidth:N */
header.container, body > footer.container { max-width: Npx; }
@media (min-width: 576px) and (max-width: calc(N + 55px)) {
  .container { padding-left: 16px; padding-right: 16px; }  /* Pico drops it, assuming narrower steps */
}

Prose pages like this one are a single 70 ch column. A one-line navigation does not fit next to the wordmark inside 70 ch. Their header is therefore two rows at every width. The two rows are deliberate; they are no fallback for narrow windows.

Scoping rules that touch the header

custom.css serves three page families. They share a header, and each family shrinks it differently. Every header or nav rule therefore hangs on a family hook: ul.site-crumbs for the tool pages, ul.site-links for the content pages, body.prose-page for everything that is not a tool. A rule meant for one family but written on a bare header nav inevitably hits the other two. A single header nav a { white-space: nowrap } stopped the breadcrumbs from shortening, and every tool page overflowed sideways.

6. Copy, language and privacy

A tool's own source note is small and quiet (11 px, --tool-note). Where a brand is named, a disclaimer sits below the note, quieter still (10 px, --tool-faint).

7. The mistakes that cost the most time

Each of these was a real bug or a real rewrite. These failure modes recur, especially when work goes fast.

  1. Rebuilding a component that already exists. Eighteen button sizes, nine identical rule bodies under nine names, seventeen hand-rolled segmented rows. Each started as a reasonable local decision.
  2. Naming a class in a comment and never defining it. The seventeen hand-rolled rows came from exactly this.
  3. Joining segments with border-right: none. The shorthand resets the color too. Eleven tools drew one edge in the wrong color.
  4. A string style in an htm template. Blank page, one minified error number, no other clue.
  5. Hex literals for grays. A hex gray looks right in the theme it was written in and wrong in the other two. Nobody notices until someone switches.
  6. Emoji in buttons. Four different pictures on four platforms, ignoring hover and the disabled state.
  7. A stack of bordered panels where one card belongs.
  8. Per-page copies of a switcher, a footer or a header script. A later fix does not reach the copies. Centralizing them took a day. Finding the copies that had already drifted took longer.
  9. Winning a specificity fight by luck. Some rules apply only because the page's own <style> comes later in the document. Such a rule stops applying the day someone reorders the files.
  10. Trusting a green test that never ran the branch. See the htm scenario table above. A passing comparison of the wrong state looks exactly like a passing comparison of the right one.

This page describes the state of the site in August 2026. The authority for any value is custom.css, which carries the reasoning next to the code.