Build a Modular Type Scale Specimen with Adjustable Ratio and Base Size

A single HTML file that turns a ratio and base size into a live editorial type specimen, a scale ladder with px and rem values, and copy-ready CSS custom properties.

You getone complete HTML file in a single code block, then 3 short ideas to extend it.

The prompt

Prompt
You are a senior typographer and front-end developer who builds polished design tools.

Build Scalewright, a modular type scale specimen page for testing editorial typography. A ratio picker and a base-size slider drive a scale from step -2 to step +5, where size = base × ratio^step. A sample magazine article re-renders live, with each element mapped to one step: display headline, stat callout, section heading, subhead and pull quote, deck, body paragraphs, byline and captions, and fine print.

Rules:
- Controls: ratio buttons for 1.125, 1.2, 1.25, 1.333, 1.414, 1.5 and 1.618, each labelled with its musical name; a base-size slider from 14 to 22px; and a serif/sans toggle that uses system font stacks only. Keyboard shortcuts: [ and ] change the ratio, - and + change the base size.
- Show a scale ladder that lists every step with its role, px and rem values, and a one-line sample at true size.
- Generate ready-to-copy CSS custom properties: a :root block with --type-base, --type-ratio and --step--2 through --step-5 in rem. Put them in a dark code panel with a Copy button that uses the Clipboard API and falls back to selecting the text. Announce the copy status in an aria-live region.
- Layout: the specimen sits beside the ladder and code on wide screens and stacks below 960px. Long headlines wrap and never overflow at 360px.
- Palette: warm paper background, near-black ink and one terracotta accent. Show visible focus rings, and turn off size transitions under prefers-reduced-motion.
- Use no external fonts, libraries, storage or alerts.

Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.

Example output

One HTML file. Save it and open it in any browser.Open full screen

Example: Scalewright, a live modular type scale specimen.

Pick a ratio, from Major Second (1.125) to Golden Ratio (1.618), and drag the base-size slider. The bakery feature article resizes instantly: headline, deck, pull quote, captions and fine print. The ladder lists every step in px and rem. Toggle Serif or Sans, press [ and ] to cycle ratios or - and + to change the base size, then hit Copy CSS to grab the custom properties.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Fixing the step range (-2 to +5) and mapping each to a named editorial role means the specimen shows real hierarchy, not abstract sizes.
  • Driving every size from CSS custom properties on :root keeps the article, the ladder and the exported CSS in sync from a single render.
  • A Clipboard API call with a select-text fallback makes Copy work even inside sandboxed previews.

Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as scalewright.html and open it in any browser, or run it in the chat's preview or canvas panel.

Common edits

  • Swap the bakery article for your own brand copy, or change the terracotta accent to your brand color.
  • Add a second ratio for small screens and export clamp() fluid sizes between the two scales.

Prompt details

By
Prompts-GPT editors
Published
How prompts are written and checked

Did this prompt work?

Keep exploring

More in Design