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.

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

The prompt

Prompt
Act as a senior typography instructor and front-end developer. Build "Hierarchy Lab", a single-page typographic hierarchy playground for design students. Show the same editorial content block twice, side by side. The block has an eyebrow, headline, standfirst, byline, body paragraph and link. The Before view is flat: every line is 16px, regular weight, one gray and has zero gaps. The After view applies only the variables the student switches on. Rules:
1. Add four toggle buttons (Weight, Size, Spacing, Color) with aria-pressed, plus keys 1-4. Isolate mode allows one variable at a time. Stack mode combines them.
2. A Subtle / Clear / Strong strength control scales every change, so students can see how much difference is enough.
3. Annotate the After view. Put numbered markers beside each changed line, plus a matching list of every exact change, e.g. Headline size 16px to 30px. Show color changes as swatches.
4. Show a one-line explanation of the active principle. Add a Squint test toggle that blurs both views, and a reset key.
5. Use a warm off-white page, white cards, near-black ink, one burnt-orange accent and system fonts. Keep all text at 4.5:1 contrast or better. Stack the panels below 760px wide, and turn off transitions under prefers-reduced-motion.
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: Hierarchy Lab, a side-by-side type hierarchy playground.

The page opens with Size switched on, so the headline already leads in the After view while Before stays flat. Press 1-4 or tap Weight, Size, Spacing and Color to isolate each variable. Switch to Stack to combine them, and try Subtle vs Strong. Numbered markers match a list of exact changes. Turn on Squint test to check which line still wins.

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

Tips and common edits

Why this works

  • A fixed flat baseline beside the styled view means every difference on screen comes from the variable you just toggled.
  • Lookup tables per variable and strength keep the changes exact, so the annotations can list real before and after values.
  • Isolate mode is the default, which forces one-variable comparisons before students start stacking effects.

Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as hierarchy-lab.html and open it in any browser, or run it in the chat's canvas or preview pane. It works offline.

Common edits

  • Swap the sample article for a product card, poster or slide headline so students can practice hierarchy on their own content type.
  • Add a fifth variable such as case (uppercase eyebrow) or typeface contrast by adding one more table and toggle button.

Prompt details

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

Did this prompt work?

Keep exploring

More in Design