Skip to main content

Design tokens from your mockup — measured, not estimated

By Muhammad Umar Javed, founder of Pixcel · Updated

Drop an image of your design into Pixcel and it measures the real colours, text sizes, borders and corner roundness, then gives you a theme file for Tailwind or CSS. Exact numbers, not guesses.

Why “estimated” tokens aren’t good enough

Ask a vision model for a screenshot’s colours and you get approximations: #1a1a1a instead of #18181B, rounded-lg instead of 6px, border-gray-800 instead of 1px #27272A. Each is close; together they make a rebuild that never quite matches. Tokens are only useful if they are the real values.

Example output

Page background: #09090B

| Token     | Background | Border            | Radius |
| surface-1 | #18181B    | 1px solid #27272A | 6px    |
| surface-2 | #F97316    | none              | 4px    |
| surface-3 | #121215    | 1px solid #27272A | 6px    |

How to extract tokens from your mockup

  1. Drop a screenshot. Open the Pixcel converter and drop a PNG or JPEG of the UI.
  2. Extract text and regions. Run text extraction and region detection; Pixcel measures every surface and text line.
  3. Generate the prompt. The prompt’s Measured Design Tokens section lists surface tokens and the type scale.
  4. Map to your theme. Paste the tokens into tailwind.config or CSS variables, or let your coding agent map them onto existing tokens.

Questions

What design tokens can be extracted from a mockup?
Surface tokens (background colour, border colour and width, corner radius), the page background, a type scale (font size, weight, text colour) and per-element bounds. Spacing can be derived from the bounds. Font family, shadows and motion cannot be measured from a still image.
How is this different from AI design-token extractors?
Most screenshot extractors ask a vision model to read the image and label the values as estimates. Pixcel measures them from the pixels: surface colours were exact and 98.6% of text colours were within ΔE 3 on our benchmark.
Can I export the tokens to Tailwind?
Yes. The tokens are plain hex values and pixel sizes, so they map directly to a Tailwind theme or CSS custom properties. The generated prompt asks your coding agent to reuse your existing tokens where they already match.