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
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
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
Did this prompt work?
Keep exploring
More like this
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.
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.
Plan a One-Page Flyer Layout with Exact Copy and Clear Hierarchy
Get a top-to-bottom flyer or poster layout map with final wording for every block, font size ratios, spacing notes and a 3-second readability test.
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 a Button and Form Field States Reference Sheet in a Single HTML File
Get a polished, single-file reference sheet that shows button and text field states side by side, with a live playground and contrast ratios computed from design tokens.
Build a Color Blindness Simulator That Previews a Palette on a Dashboard Card
A single HTML file that redraws a realistic dashboard card under protanopia, deuteranopia, tritanopia and grayscale and flags color pairs that become hard to tell apart.
- 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 Light/Dark Mode Toggle Demo Page with Smooth Theme Switching
- 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
- Build a Multi-Step Onboarding Wizard with Stepper and Inline Validation