Topic 1 of 4 · 4 min read
Comparing built screens against the design
Goal: Compare an agent-built screen with its design and list each mismatch in spacing, type, colour and component use.
Compare a built screen with its design by measuring both against the same list: spacing, type, colour and components, and write every mismatch down. Looking at the two and deciding that it "feels right" misses most of the drift.
Check yourself · 1 of 3
An agent builds a screen from a design. The page header gap is 12 px, the design says 8 px. What is the best way to record this?
Why it matters
Coding agents and prompt-to-UI tools (Cursor, Claude Code, v0, Lovable, Figma's own code export) turn a design into working screens fast. They also make small, confident substitutions. A 12 px gap becomes 10. A brand grey becomes a nearby grey. A shared button becomes a fresh <button> with similar styles. Each change is tiny. Together they make the product look unfinished and break the design system.
How to do it
- Put both at the same size. Open the design frame and the live page at the same width, on the same device pixel ratio, with the same content.
- Check one property family at a time. Spacing first (padding, gaps, alignment), then type (family, size, weight, line height), then colour, then components.
- Use the tools, not your eyes. Inspect the design for exact values. Inspect the built page in browser dev tools and read the computed values.
- Look for token drift. A design token is a named value, such as
space-3ortext-muted. If the built page shows a raw value like#6b7280or13pxwhere the design uses a token, the agent copied a look instead of using the system. - Check components. Is each button, input and card the real shared component, or a lookalike? A lookalike will miss the next system update.
- Log each mismatch as one row: element, property, design value, built value, severity.
Before and after
Weak review note: "Spacing looks a bit off on the card." Nobody can fix that.
Fixed note: "Order card, vertical gap between title and price: design 8 (token space-2), built 12 (hard-coded). Price weight: design 600, built 700. Both fix by using the Card component's own slots."
What goes wrong
- Reviewing against a screenshot of the design. Compression hides exact values. Use the design file.
- Accepting "close enough" for each item. The drift is visible only in total.
- Ignoring content. The design shows a short name. Real data is longer. That is the next topic.
- Fixing the CSS and not the cause. If the agent never saw the tokens, tell it where they live or it will drift again.
Examples
A mismatch log
| Element | Property | Design | Built |
|---|---|---|---|
| Page title | Size | 28 (text-xl) |
30 |
| Primary button | Fill | brand-600 |
#2f6fed |
| Card gap | Spacing | 16 (space-4) |
20 |
| Date field | Component | shared DatePicker |
custom input |
Four rows, four fixes, and the last one is the most important.
Colour that is nearly right
The design uses a muted text colour for helper text. The agent chose a grey that looks the same on a laptop. In dev tools it is a different hex value and fails the contrast ratio the design met. A side-by-side look passes it. A value check does not.
Key points
- Compare at the same width and the same content, one property family at a time: spacing, type, colour, components.
- Read exact values from the design file and from computed styles in dev tools; do not judge by eye or from a compressed screenshot.
- Token drift means a raw value such as a hex colour or pixel size appears where the design uses a named token.
- A lookalike button or card built from scratch is a mismatch even when it looks identical today.
- Log each mismatch with element, property, design value, built value and severity so it can be fixed.
Common mistakes
- Judging fidelity by eye at different zoom levels or widths.
- Treating a hard-coded value that matches today's token as fine; it will not follow the next change.
- Accepting a lookalike component because it renders the same.
- Listing problems as vague feelings instead of element, property and values.
Check yourself · 2 of 3
What is token drift?
Check yourself · 3 of 3
A built page uses a new button element styled to look like the design's shared Button. Is this a mismatch?
Practice items, not counted towards your mastery.
Start here
- Visual comparisons (Playwright docs) (opens in a new tab)DocsFree
How screenshot assertions create baselines, set thresholds and mask unstable areas.
- Visual tests (Storybook docs) (opens in a new tab)DocsFree
Catching visual changes per component and state, and reviewing them before they merge.
- axe-core (Deque) (opens in a new tab)ToolFree
The open-source rules engine that checks rendered pages for contrast, labels and other accessibility faults.
More for this topic
- Design Tokens Format Module (W3C Design Tokens Community Group) (opens in a new tab)StandardFree
What a design token is: a named value for colour, spacing or type that code should reference by name.