Single logo
  • Courses
  • Blog
  • About
Join on SkoolJoin on Skool

In this topic

React
  • One Request, Two Answers: the Same Post as an HTML Page and as JSON
  • A Blog Design from a Prompt: Downloading Figma Make Code and Reading App.tsx and BlogCard.tsx
  • How a Web Page Works: HTML Tags, Elements and Attributes
  • Semantic HTML: header, nav, main, aside and footer as Page Landmarks
  • HTML Forms: Labels, Names, Input Types and Where the Data Goes (GET vs POST)
  • CSS Basics: Selectors, Which Rule Wins, and the Box Model
  • CSS Flexbox vs Grid: A Nav Bar, a Card Row and a Dashboard
  • Responsive CSS: Viewport, Mobile-First Media Queries, clamp() and Dark Mode with Tokens
  • JavaScript for People Who Already Code: Syntax, Modules and Five Surprises
  • JavaScript Arrays the Functional Way: map, filter, reduce, find, sort and Object.entries
  • Async JavaScript: Promises, async/await, fetch and Promise.all
  • JavaScript in the Page: the DOM, querySelector and Events
  • npm, package.json and Vite: What npm install Fetches and How Vite Serves and Builds Your Page
  • TypeScript Essentials: Types Checked, Then Erased (Interfaces, Unions, Generics)
  • Why React, JSX and Components: The Page as a Function of Data
  • React Props and Composition: Data Down, Calls Up, Children in the Slot
  • Routing With React Router: One Page, Many Addresses
  • React Component Tests With Vitest and Testing Library: Test What the User Sees
  • End-to-End Tests for a React App With Playwright: A Full Dress Rehearsal
  • Why AI-Built Websites All Look the Same, and Four Levels That Fix It
  • Visual Hierarchy, Spacing and the 8-Point Grid: Tell the Eye What to Read First
  • Colour, Contrast and Dark Palettes: 60-30-10, Semantic Tokens and Ratios You Can Compute
  • Typography That Sells: Type Scale, Line Length and Free Font Pairings
  • The UI Element Catalogue: Buttons to Toasts, Their Jobs, States and shadcn/ui Names
  • Design Tokens: Primitive and Semantic Tokens, from Figma to CSS to Tailwind
  • Tailwind CSS 4 in React: Utility Classes, Responsive Prefixes, Hover and Dark Mode
  • shadcn/ui in React: Components You Own, Edit and Commit
  • Design Tokens to a Tailwind Theme: Light and Dark Mode with @theme inline
  • Motion in React: Entrance, Hover, Exit and Layout Animations
  • A React Dashboard: Stat Cards, a Recharts Line Chart and a Sortable Table
  • Accessibility in Practice: Dialogs, Menus and the Keyboard in React
  • Reference-Driven Design: Extract a DESIGN.md From a Site You Admire and Build From It
  • Components, Variants and Variables: One Design System in Figma and in CSS
  • Figma MCP Server: Build a React Component From a Frame, Then Write It Back
  • Claude Design: From a Brief to a Clickable Prototype, Then Hand It Off to Claude Code
  • Critiquing AI-Generated UI: Six Checks for Every Screen
  • The AI Design Landscape: Prompt to UI, Prompt to App, and Design to Code
  • Your Brand Rules Folder: One Folder Every AI-Built Page Follows
  • The Best-Practice UI Prompt: Plain Sentences That Beat the Average AI Page
  • UI Ideas From Figma Make, Google Stitch and ChatGPT: One Prompt, Three Designs
  • Google Stitch From a Sketch or Screenshot: Show the Layout, Say What to Keep
  • Stitch to Figma to Code: Turn a Stitch Screen Into Code That Uses Your Tokens
  • Figma Make: Prompt to Prototype With a Four-Part Prompt
  • Upgrade a Dated UI From One Screenshot (or a Reference Image)
  • States and Feedback: Make Every Click Get an Answer
  • A Design-Loop Skill: Claude Screenshots, Scores and Fixes Its Own UI
  • Copy Without the AI Tells: A Copy Pass on a Landing Page
  • React State, Events, Lists and Conditional Rendering: Follow One Click
  • React useEffect: When It Runs, What Cleanup Is For, and When You Don't Need One
  • Lifting State Up, Refs and React DevTools: Put State Where It Is Needed
  • Forms and Actions in React 19: Controlled Inputs, Form Actions, useActionState and useFormStatus
  • React Context and Custom Hooks: Share One Value, Reuse the Logic
  • Server State With TanStack Query: One Key, One Request, One Cache
  • Mutations and Optimistic Updates in TanStack Query: Change Data, Then Tell the Cache
  • Generate TypeScript Types, Query Hooks and Zod From an OpenAPI Spec With Orval
  • A Mock Backend in the Browser With Mock Service Worker, Generated From the Spec
  • A React Client for a FastAPI API: The CORS Wall, CORSMiddleware and the Vite Proxy
  • Forms With React Hook Form and Zod: The API's Rules in the Browser, the Server's Errors Under the Field
  • JWT Auth in a React Client With a FastAPI Backend: Log In, Carry the Token, Let the Server Decide
  1. Blog
  2. /
  3. React
  4. /
  5. Fundamentals

Reference-Driven Design: Extract a DESIGN.md From a Site You Admire and Build From It

Turn 'make it nice' into a target: pick a reference page, copy its exact colours, type, spacing, radius and motion into DESIGN.md, and have the agent build a new Today page from only those values.

Chaand Sheikh

·27 November 2026·Updated 28 November 2026Fundamentals

What you will learn

  • Explain why a reference beats 'make it nice' as a brief for an AI agent
  • Pick the reference that fits a brief and say why
  • Extract colour, type, spacing, shape and motion values into a short DESIGN.md
  • Build a new page that uses only the values in that file, and check it

Before you start

  • Why AI-Built Websites All Look the Same, and Four Levels That Fix It
  • Basic HTML and CSS custom properties

Walk into a tailor shop and say "make me something that looks nice". One jacket comes out purple and round, the next blue and sharp, the third orange and loud. Four requests, four guesses, and nothing belongs together. Now hand the tailor a photo of a jacket you love and say "like this". Every piece comes out in the same style.

An AI agent building UI works the same way. "Make it nice" gets you a different guess each time. A good reference turns it into a target the agent can match. The method in this article: pick a site you admire, pull its colours, type, spacing, radius and motion into one file called DESIGN.md, and make every page follow that file.

A folder of strong references

Keep a small folder of reference pages the agent can read. The project has three, each in a clearly different style, with every value as a variable in :root:

PaperNightSoft
Feelcalm, printeddark, technicalround, playful
Page colour#FAF6EE#0B0F14#FFF1F5
Accent--brand: #1F4E3D--accent: #B6F24A--brand: #7C5CFF
TypeGeorgia serif headingsConsolas monospaceTrebuchet MS
Spacing unit8px4px8px
Radius4px10px28px
Motion200ms ease-out120ms, glow on hover350ms, bouncy curve

Three pages, three very different styles. The folder is your library.

Let the agent pick one

The brief is one line: a calm task app for students. The prompt asks the agent to look at the three references, pick the one that fits, and say why in two lines. The reasoning in the lecture went like this:

  • Paper: calm and printed, easy to read for hours. Yes.
  • Night: dark and technical, too heavy for students.
  • Soft: round and playful, too childish for a study app.

The agent matches the feel of the brief and explains its choice. You can always disagree and pick another.

Five things to pull out

Reference to DESIGN.md to new page paper.html :root values DESIGN.md colour type spacing shape motion rules Today page only these values copy follow
Pick, extract, follow. The values are copied from the reference's :root, not guessed.

Once Paper is chosen, the agent reads references/paper.html and writes five things down, copying the exact values from its :root block:

  1. Colour: six values, the page, the card, the ink, the muted text, the line and the brand colour.
  2. Type: serif headings, a system font for the body, and a short list of sizes. Too many sizes is how a page starts to look messy.
  3. Spacing: one base unit of 8px, used as 8, 16, 24 and 48.
  4. Shape: small 4px corners, thin borders, no shadows.
  5. Motion: fast and quiet, 200ms ease-out, and a card lifts 2px on hover.

The real DESIGN.md

# DESIGN.md - Paper

Source: references/paper.html
Feel: calm, printed, trustworthy

## Colour
- page: #FAF6EE
- card: #FFFFFF
- ink: #1F1B16
- muted: #6B6257
- line: #E4DCCB
- brand: #1F4E3D

## Type
- headings: Georgia, serif, bold
- body: system-ui, 18px / 1.6
- sizes: 16, 18, 20, 24, 56

## Spacing
- base unit: 8px (use 8, 16, 24, 48)

## Shape
- radius: 4px
- borders: 1px solid line, no shadows

## Motion
- 200ms ease-out
- hover: lift 2px, links underline slides in

## Rules
- Use only these values.
- Brand colour for the one main action only.
The Paper palette page#FAF6EE card#FFFFFF ink#1F1B16 muted#6B6257 line#E4DCCB brand#1F4E3D
The six colours in DESIGN.md, exactly as they appear in the reference's :root.

The file is short and exact, and that is a good thing: the agent reads it every single time. The Rules section tells it what not to do. Use only these values, and the brand colour is for the one main action only.

One page, built from the file

Now a brand-new page, a task list rather than a landing page. The prompt:

Build a Today page: a nav, a heading, three tasks with checkboxes and an Add a task button. Follow DESIGN.md exactly. Put every value from DESIGN.md in :root of styles.css and use only those variables. Do not invent a new colour, size or radius.

The agent's stylesheet, ex02-built-from-design/styles.css, puts exactly those values in :root and uses only them:

:root {
  --page: #FAF6EE;
  --card: #FFFFFF;
  --ink: #1F1B16;
  --muted: #6B6257;
  --line: #E4DCCB;
  --brand: #1F4E3D;
  --font-head: Georgia, "Times New Roman", serif;
  --font-body: system-ui, "Segoe UI", sans-serif;
  --space: 8px;
  --radius: 4px;
  --speed: 200ms ease-out;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 18px/1.6 var(--font-body); }
nav { display: flex; align-items: center; gap: calc(var(--space) * 3); padding: calc(var(--space) * 3) calc(var(--space) * 6); border-bottom: 1px solid var(--line); }
nav b { font: 700 24px var(--font-head); margin-right: auto; }
nav a { color: var(--ink); text-decoration: none; background: linear-gradient(var(--brand), var(--brand)) 0 100% / 0 2px no-repeat; transition: background-size var(--speed); }
nav a:hover { background-size: 100% 2px; }
main { padding: calc(var(--space) * 5) calc(var(--space) * 6); max-width: 860px; }
h1 { font: 700 56px/1.1 var(--font-head); margin: 0 0 var(--space); }
main > p { color: var(--muted); font-size: 20px; margin: 0 0 calc(var(--space) * 3); }
.task { display: flex; align-items: center; gap: calc(var(--space) * 2); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: calc(var(--space) * 2) calc(var(--space) * 3); margin-bottom: var(--space); transition: transform var(--speed); }
.task:hover { transform: translateY(-2px); }
.task input { width: 20px; height: 20px; accent-color: var(--brand); }
.task span { flex: 1; }
.task small { color: var(--muted); font-size: 16px; }
.btn { display: inline-block; margin-top: calc(var(--space) * 2); background: var(--brand); color: #fff; border: 0; border-radius: var(--radius); padding: calc(var(--space) * 1.5) calc(var(--space) * 3); font: 600 16px var(--font-body); transition: transform var(--speed); }
.btn:hover { transform: translateY(-2px); }

The colours come from the file, the corners and spacing match, and hovering a task card or the button lifts it 2px in 200ms. The heading is serif and the nav is quiet, just like Paper. Nav links get an underline that slides in, the same effect the reference uses. It is a new page, and it feels like the reference.

Finish with a check prompt: Check the page against DESIGN.md and list every value that is not in the file. Fix any hit.

Exercise: recreate a reference 1:1

  1. Open it. Pick a reference, say Night, and look at it closely.
  2. Rebuild it. Ask the agent to build the same page with new HTML and CSS, no copying the file.
  3. Compare. Put both pages side by side and check spacing, size, colour and motion.
  4. Fix. Ask for a list of every difference and fix them until the two match.

Matching a page exactly trains your eye. After two or three tries you start to see details like a missing 2px of spacing, and that is a real design skill.

Common mistakes

  • Describing the feel instead of copying values. "Warm and calm" is a guess. #FAF6EE is a target.
  • A long DESIGN.md. The agent reads it every time; keep it short and exact.
  • No rules section. Without "use only these values", the agent adds a new grey or a new radius on page three.

Quick recap

StepWhat you do
PickChoose the reference that fits the brief, and say why
ExtractCopy colour, type, spacing, shape and motion into DESIGN.md
RuleUse only these values; brand colour for the main action only
FollowEvery new page puts the file's values in :root and uses only them
CheckAsk for every value not in the file, and fix it

These are foundations; with AI you can generate the rest, but these steps let you check what it gives you. The reference pages, DESIGN.md and sample prompts are in the StudyEasy AI Community, free to join.

Keep going in React · 32 of 59

Previous
Accessibility in Practice: Dialogs, Menus and the Keyboard in React
Next post
Components, Variants and Variables: One Design System in Figma and in CSS
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

The Python Architect Masterclass: Full Stack to AI Engineer

Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)

Related posts

One Request, Two Answers: the Same Post as an HTML Page and as JSON

Ask a Django blog for the same post twice: once as a 12,731-byte HTML page built by a template, once as 2,976 bytes of JSON built by a serializer. Compare the headers, see who builds the page, and why the server still owns every write.

A Blog Design from a Prompt: Downloading Figma Make Code and Reading App.tsx and BlogCard.tsx

Make a blog design from a prompt in Figma Make, download src.zip, unzip it with Python's zipfile module, and read the two files that matter: App.tsx with its selectedPost state and BlogCard.tsx with its props.

How a Web Page Works: HTML Tags, Elements and Attributes

A web page is a text file full of labelled pieces. Learn tags, attributes and nesting with three tiny pages, and see what breaks when an attribute or a closing tag is wrong.

Semantic HTML: header, nav, main, aside and footer as Page Landmarks

The same page written as div soup and with semantic tags looks identical, but only one gives screen readers and search engines landmarks and an outline. Plus tables, div, span and the one-main rule.

On this page

  • A folder of strong references
  • Let the agent pick one
  • Five things to pull out
  • The real DESIGN.md
  • One page, built from the file
  • Exercise: recreate a reference 1:1
  • Common mistakes
  • Quick recap
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

The Python Architect Masterclass: Full Stack to AI Engineer

Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)

Single logo

Empowering Education, One Course at a Time

About
About usContact us
Legal
Terms of UsePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.