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
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
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
Did this prompt work?
Keep exploring
More like this
Build a System Font Pairing Explorer With Real Layouts in One HTML File
A single offline HTML page that compares seven heading and body font pairings built from system font stacks, previewed in article, card and button layouts with a rationale for each.
Build a Light/Dark Mode Toggle Demo Page with Smooth Theme Switching
A single HTML page with a polished light/dark theme switch built on CSS custom properties that defaults to the system theme, honors reduced motion, and uses no storage.
Build a Typographic Hierarchy Playground Comparing Weight, Size, Spacing and Color
A single HTML file that shows the same text block twice, flat and styled, letting students switch on weight, size, spacing or color one at a time and see each change annotated.
Build an Interactive Brand Style Board With Logo, Colors, Type and Voice
A prompt that makes the AI build a one-page brand board for a fictional tea company, with click-to-copy colors, a type tester, do/don't logo tiles and tone-of-voice samples.
Build an OKLCH Tint and Shade Scale Generator in a Single HTML File
A ready-to-paste prompt that builds an offline color tool turning one brand color into an even 50–900 OKLCH ramp with contrast badges and CSS or JSON token export.
Accessible Color Palette and Type Pairing With Contrast-Checked Text Pairs
Builds a brand palette with a neutral ramp and semantic colors, text and background pairs with WCAG contrast ratios, two font pairings, a type scale and CSS variables ready to paste.
- Build a Button and Form Field States Reference Sheet in a Single HTML File
- Build a Color Blindness Simulator That Previews a Palette on a Dashboard Card
- Build a Drag-to-Arrange Brand Mood Board with Color, Texture and Type Tiles
- Build a Draggable Color Harmony Wheel With Live UI Preview in One HTML File
- Build a Live Accessible Color Palette Builder with a WCAG Contrast Matrix
- Build a Logo Lockup and Clear-Space Guideline Sheet with an Original SVG Mark