Skip to Content
CodeUI

Typography

@codeui/inkstone v0.3.0

Small, steady interface text. 13px base, three weights, sentence case, tabular numbers.

Interface text in Inkstone is small and steady. Most of a screen is 12 to 14px, with a 13px base. The interface is a tool next to the user's work, so its text needs to be easy to read and should not attract attention.

Families

The interface uses Inter with four character variants turned on ("cv02", "cv03", "cv04", "cv11"). They give Inter open digits and a single-storey a, which read better at small sizes. The kit does not bundle the font. The app loads it with font-display: swap, and the system font is the fallback.

Code uses whatever monospace the user picks. In CodeImage the default is JetBrains Mono. The interface uses a monospace only for code, file paths and hex values.

Hierarchy never comes from a third font family. It comes from tone and weight.

Scale

StepSizeWeightUse
Micro11px500Badges, tags, keycaps. One word
Meta12px400, 600 for group labelsDescriptions, summaries
Base13px400Running text, row labels inside a section
Label14px500 or 600Row titles, menu items, buttons, section headers
Title16px600Group titles, breadcrumbs, phone inputs
Display18px+600Announcements only

Every component sets its own line height from three tokens and never inherits the page's: --cui-font-line-height-compact (1.15) for one-line chips such as tooltips and keycaps, --cui-font-line-height-snug (1.3) for the Label and Title steps (menu rows, popover text, toasts), and --cui-font-line-height-normal (1.5) for running text.

No text below 11px

The Animate timeline once had a 9.5px label, and it was rejected as unreadable. At 11px and above, Inter stays legible on a standard display.

Three weights

  • 400 for text the user reads.
  • 500 for things the user acts on, such as buttons and row titles.
  • 600 for headings.

A selected option may become bolder only if its box already reserves the bold width. Otherwise selecting it pushes its neighbours sideways.

Rules that keep text steady

  • A section heading is text, not a row. It has no fill, no row height and no capitals: Label or Meta at 600 in secondary text, with a count in tertiary text at 400. In CodeLoom, a "Pinned" shelf drawn with a row's height and fill read as one more item, not as the start of a group.
  • Tabular numbers. Durations, sizes, zoom levels and timers use font-variant-numeric: tabular-nums, so the row does not shift while a value counts up.
  • Truncate values, not labels. A long value ends in an ellipsis inside a capped width, and the full text stays reachable through a tooltip or the accessible name. A label is never cut.
Do
Step 11.11 s
Step 20.80 s
Step 310.48 s
Step 44.70 s
Tabular figures. Every digit has the same width, so the decimal points line up and a counting value does not jitter.
Don't
Step 11.11 s
Step 20.80 s
Step 310.48 s
Step 44.70 s
Proportional figures. A 1 is narrower than a 0, so values of the same length end at different points.
Do
Background
linear-gradient(152…
The label keeps its full width and the value truncates. The full value is in the tooltip.
Don't
Backgr…
linear-gradient(152deg, #de9b6e 0%)
The label is cut to make room for the value. The user can no longer tell what the field is.
  • Sentence case. Labels, buttons and titles use sentence case. Store text in natural case and let CSS transform it if needed.
  • Short words. A label is a noun or a short verb phrase. A hint is one line, and if it needs two, the setting needs a better name. A badge is one word: "Default", "Experimental".
  • Real characters. Use …, →, × and ⌘, and curly quotes in rendered text.
  • At least 16px for fields at touch density and on touch devices. This avoids focus zoom on iOS, so a compact layout on a phone keeps it. Medium fields and buttons use 16px at every density.

Proposed

text-wrap: balance on titles and short descriptions, and text-wrap: pretty on paragraphs. CodeImage does not use them yet. They prevent a single word sitting alone on the last line of a two-line hint.

On this page