Prompt to extract design tokens from an export into DESIGN.md

Short answer

This prompt asks an AI assistant to read the CSS and HTML of an exported site and write a DESIGN.md with its colors, font families, type scale, spacing steps, radii and shadows, each with the file where it was found. It then proposes a Tailwind theme block from the same list.

Last reviewed

Key facts

  • Tailwind theme values live in an @theme block, with names such as --color-* and --font-*.
  • A token list should be small: the fewest values that reproduce the design.
  • Every value in DESIGN.md should name the file where it was found, so you can check it.
  • Test status: run on a real export. The CSS names fonts with hashed identifiers, so the prompt now tells the assistant to resolve them through @font-face.

The prompt

Paste this into Claude Code, Cursor, Gemini CLI or another AI coding assistant with your project folder open, and replace everything in square brackets first. See how to run it in each tool.

Extract design tokens
You are documenting the design system of a static site in [SITE_FOLDER: ./exported-site]. Read every .css file and every inline style.

OUTPUT DESIGN.md WITH THESE SECTIONS
1. Colors: the brand and neutral colors, each with the hex value, a role (primary, text, background, border, accent) and where it is used most. Merge near-identical values and say which you merged.
2. Typography: font families with weights, then the type scale as a table of size, line height, weight and where it is used (h1, h2, body, caption).
3. Spacing: the spacing steps that repeat (for example 8, 16, 24, 40, 64 pixels) and the container width.
4. Radii and shadows: the values that repeat and where they appear.
5. Components: buttons, cards and form fields, each with the tokens it uses.
6. Breakpoints: the media query widths the CSS uses.

RULES
- Give the file and line for every value.
- Font families may be hashed names. Resolve each one through its @font-face rule or CSS variable to the real font name, and say when you cannot.
- Report only what is in the files. Do not guess a design intent.
- Keep each list short. If a value appears once, leave it out and list it under "One-offs".

THEN
Write a Tailwind v4 theme block for src/input.css using an @theme section with --color-*, --font-*, --radius-* and --breakpoint-* variables from the lists above.

How to run it

  1. Work on the unzipped export so the assistant can read every stylesheet.
  2. Send the prompt, then read DESIGN.md next to the live site and check the colors with a picker.
  3. Trim the lists. Ask the assistant to merge any two values that look the same on screen.
  4. Use the Tailwind block in a project, or keep DESIGN.md as the written brief for a redesign.

What the Tailwind block looks like

Tailwind’s docs describe theme variables in an @theme block. The names below are examples of the shape, and your values come from the extraction.

src/input.css
@import "tailwindcss";

@theme {
  --color-brand: #6139fb;
  --color-ink: #0d0a1b;
  --font-sans: "Inter", sans-serif;
  --radius-card: 18px;
  --breakpoint-lg: 64rem;
}

Verify the result

Count the distinct colors and font families in the CSS, then compare with the lists in DESIGN.md. The two should be close, and the extra values should sit under One-offs.

terminal
grep -rhoE "#[0-9a-fA-F]{3,8}" exported-site --include="*.css" | sort | uniq -c | sort -rn | head -20
grep -rhoE "font-family:[^;]+" exported-site --include="*.css" | sort | uniq -c | sort -rn | head
  • The most used colors in the first command appear in the Colors section.
  • Every font family in DESIGN.md is a font you can see on the live site.
  • The token lists are short enough to hold in your head.

What can go wrong

  • The assistant lists every color it finds, and the file becomes a dump. The prompt asks for roles and merging.
  • Colors defined as variables resolve at runtime. Ask the assistant to follow the variable to its value.
  • A token that looks right in the CSS but never shows on a page. Check usage on the live site.

Frequently asked questions

What is DESIGN.md for?

It is a written description of the design that an AI assistant or a person can read before changing the site. It keeps new pages consistent with old ones.

Does this copy another company’s design?

Use it on your own site. Extracting the design system of a site you do not own can raise copyright and trademark questions, so take advice before you reuse it.

Can I use the tokens outside Tailwind?

Yes. The list works as plain CSS variables or in any design tool. The Tailwind block is one possible output.

Which tools help check the colors?

The Exported Site Contrast Auditor tests color pairs for readability, and the Framer Site Analyzer lists fonts and colors of a published Framer site.

Official documentation

Free tools for this job

Start with the files

Prompts work best on a WebExport download of your site. Paste your public URL into the export form and get a ZIP. The Free plan covers 1 site, 5 exports a month, 15 pages and 20 MB per export. Professional is a $9.99 one-time purchase with unlimited pages.