Design and developer tools3 min read

Type Lab

From browsing a font to exporting a type system: pairing, variable axes, fluid scales and previews from shared inputs.

Built with Next.js, TypeScript, Variable Fonts, CSS, Design Tokens

Type Lab screenshot

A typography decision needs somewhere to go

Kern began as a variable-font explorer. Type Lab extends the workflow: browse the catalogue, choose heading, body and mono roles, compare them in interface previews, tune a fluid scale and export the result. The output matters as much as the specimen.

Make the catalogue resilient

The catalogue should refresh without requiring every visitor to wait for an upstream service.

  • Only serve a live catalogue

    Fresh data, but a slow or changed upstream response blocks the first useful screen.

  • Live metadata with a bundled fallbackChosen

    Try the keyless Google Fonts metadata endpoint, then the official API when configured, then a bundled snapshot. A short patience window lets the page return the snapshot while refresh continues.

Source selection is explicit in lib/catalogue/fetch.ts. The snapshot can also be rebuilt deliberately, rather than relying on a hand-maintained font list.

Pairing with reasons

Suggestions combine category contrast, curated pairings and font measurements where available. Each suggestion carries its reasons. They are typography heuristics, not a model predicting which pairing will perform best. Variable axes use each font’s actual range rather than assuming every family exposes the same controls.

One system behind the previews and exports

A good-looking preview is misleading if copying the output produces different typography.

  • Calculate each export independently

    Easy to start, but the preview, CSS and token output can drift.

  • Generate from shared role and scale inputsChosen

    Use the same heading, body and mono state, catalogue entries and scale steps for CSS, Tailwind and token exports.

Scale arithmetic keeps full precision until formatting. Both ends of the viewport range define the fluid interpolation. Interface previews make the pairing reviewable in context.

Be explicit about fluid tokens

Gave up
A fluid clamp() value cannot be represented as a single standard DTCG dimension.
Got
Each scale step exports minimum and maximum typography tokens. A namespaced extension carries the clamp() expression for tools that understand it; consumers still need to implement the interpolation.

A route for each part of the job

The root is now the font browser. Pairing, the scale and export each have their own route, and the traditional specimen lives at /specimen. Behind them sit four small modules (scale, export, pairing and the catalogue fetch) so every view and every export reads from the same state.