Skip to content

refactor(desktop): consolidate type ramp to 6 prose sizes + 1 mono - #3797

Open
thomaspblock wants to merge 1 commit into
mainfrom
wintermute/typeramp-6-prose-1-mono
Open

refactor(desktop): consolidate type ramp to 6 prose sizes + 1 mono#3797
thomaspblock wants to merge 1 commit into
mainfrom
wintermute/typeramp-6-prose-1-mono

Conversation

@thomaspblock

Copy link
Copy Markdown
Contributor

Summary

Consolidates the desktop app's 13 in-use text sizes into a single 7-step type ramp — 6 prose sizes + 1 mono — by remapping the size tokens in desktop/tailwind.config.js. Existing class names compile onto the new steps, so no component files are touched.

Proposed and evidenced by @jmarr with before/after captures of the running app: buzz-typeramp-diffs.zip (13 settings screens + 5 daily-driver surfaces, captured through the Playwright e2e harness at commit 4253688 with the token remap as the only variable).

The ramp

Role px Token Replaces (old px)
Display 40 text-title (+ text-4xl/text-5xl aliases) 36, 40, 48
Key (mono) 36 text-nsec-key unchanged
Page 30 text-3xl 30
Section 24 text-2xl 24
Title 18 text-lg (+ text-xl alias) 18, 20
Body 14 text-sm (+ text-base alias) 14, 16
Meta 12 text-xs (+ text-2xs/text-3xs/text-badge aliases) 8, 10, 11, 12

The net visible change is two moves:

  • 16→14 — descriptions and small semibold card/section titles fold down to Body, sitting one clean step below their 18px headers.
  • sub-12→12 — the meta band (timestamps, labels, count badges) lifts to Meta 12.

Body 14 and Meta 12 carry ~95% of all text (987 text-sm + 597 text-xs call sites), so most screens barely move. Every remaining prose step is ≥1.17×, most ≥1.25×.

Why remap tokens instead of rewriting call sites

One file, one owner, zero churn across ~1,800 call sites. Legacy names (text-2xs, text-badge, text-base, text-xl, text-4xl, text-5xl) become documented aliases of their ramp step; call sites can migrate to canonical names incrementally without any visual change.

Verification

  • pnpm build (tsc + vite) ✅
  • pnpm typecheck
  • pnpm check (biome + file-sizes + px-text guard + pubkey-truncation) ✅
  • pnpm test — 3835/3835 pass ✅
  • Compiled CSS inspected: .text-2xs/.text-3xs/.text-badge → 0.75rem, .text-base → 0.875rem, .text-xl → 1.125rem, .text-4xl/.text-5xl → 2.5rem, and rem-based sizing preserved so Cmd +/- zoom still scales everything.

Screenshots in the linked zip are light theme; dark theme uses identical sizes so the deltas are the same.

The desktop app had 13 distinct in-use text sizes. Collapse them to a
single 7-step ramp — Meta 12, Body 14, Title 18, Section 24, Page 30,
Display 40, plus the 36px mono nsec key — by remapping the size tokens
in tailwind.config.js so existing class names compile onto the new
steps. No component files are touched.

The remap:

- Sub-12 meta band folds up to Meta 12: text-3xs (8px), text-badge
  (10px), text-2xs (11px) become aliases of the 12px xs step.
- text-base (16px) folds down to Body 14, so descriptions sit one
  clean step below their 18px headers.
- text-xl (20px) folds down to Title 18.
- text-4xl (36px) and text-5xl (48px) fold to a single Display 40,
  matching text-title.

Body 14 and Meta 12 carry ~95% of all text, so most screens barely
move; the two visible deltas are descriptions 16→14 and the meta band
lifting to 12. Every remaining prose step is ≥1.17x its neighbor.

Before/after captures of all 13 settings screens and 5 daily-driver
surfaces (from the running app via the Playwright e2e harness, with the
token remap as the only variable) are attached to the PR.

Co-authored-by: Thomas Petersen <thomasp@squareup.com>
Signed-off-by: Thomas Petersen <thomasp@squareup.com>
@thomaspblock
thomaspblock requested a review from a team as a code owner July 30, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant