Extract design system from any website into a Tailwind Config
Pull the colors, fonts, spacing, radii and shadows out of any live website with DevTools, then turn them into a clean Tailwind v3 or v4 theme.
Every polished website runs on a small set of decisions: a handful of colors, a type scale, a spacing rhythm, two or three corner radii and a shadow or two. Those decisions are its design system, and the browser has all of them. This guide shows how to pull them out of any live site and turn them into a Tailwind theme you can build on.
What you're actually extracting
A design system on a live site comes down to a few kinds of tokens. Here's where each one lives in the CSS, and where it goes in Tailwind:
You don't need all of them. Colors, fonts and the type scale give you about 80% of a site's look.
Step 1: Check whether the site already has tokens
Start here, because it might save you all the other steps. Sites built with shadcn/ui, Radix Themes, Tailwind v4 or most in-house design systems define their tokens as CSS custom properties on :root.
The quick check: in DevTools, select the <html> element and look at the Styles pane. If you see a wall of --something: value lines, you've found the design system. To grab all of them at once, run this in the console:
If you got a tidy list like --primary, --muted-foreground and --radius, skip to Step 5. If you got nothing, or only framework noise, read on.
Step 2: Tally the colors
When a site has no tokens, the system is still there, spread across thousands of elements. The trick is to count: the values used most often are the real tokens, and the rare ones are exceptions.
Paste this helper into the console once. It counts how often each value of the properties you give it appears across the page:
Now tally text and background colors:
The top few rows are your foreground, muted text and background colors. An accent color usually shows up lower down with a small count, on buttons and links. That's expected: accents are used sparingly on purpose.
For border colors, count only elements that actually have a border. Every element has a border-color (it defaults to the text color), so without the filter you just get your text colors again:
Step 3: Get the type scale
Tally sizes, line heights and weights separately:
A well-built site will show five to eight font sizes doing almost all the work, for example 14px, 16px, 18px, 24px, 36px and 48px. Pair each size with the line height it's most often used with, and you have a type scale. If you're also trying to pin down the typeface itself, this guide to identifying a website's font covers it in depth.
Step 4: Spacing, radii and shadows
For spacing, look for the base unit rather than every value. If nearly everything is a multiple of 4px (8, 12, 16, 24, 32), the site uses a 4px grid, which is Tailwind's default. For radii and shadows, expect two or three values that really matter.
Step 5: Clean it up
This is the step most tools skip, and the one that makes the result usable. A raw tally is a list of values. A design system is a set of decisions with names.
Three rules get you there:
- Merge near-duplicates.
rgb(15, 23, 42)used 412 times andrgb(18, 25, 43)used 3 times are the same color. The rare one is a leftover or a mistake, so fold it into the common one. - Snap to a scale. A
15pxnext to14pxand16pxis almost always one of them in disguise. Round spacing to the grid you found in Step 4. - Name by role, not by value.
foreground,muted,borderandaccentstay meaningful when you change the actual colors later.slate-850doesn't.
Step 6: Write the Tailwind config
Tailwind v4 keeps the theme in CSS, in an @theme block:
Each variable becomes a utility class automatically: --color-muted gives you bg-muted and text-muted, and --shadow-card gives you shadow-card.
Tailwind v3 uses tailwind.config.ts:
Using extend keeps Tailwind's defaults alongside your tokens. If you want to be strict and allow only the extracted palette, move colors up a level, out of extend.
Is the manual method worth it?
- Free, and works on any site
- You see every value, so nothing is guessed
- Teaches you how the site is really built
- Takes 15 to 30 minutes per site
- The cleanup is judgement work
- Can't read tokens from stylesheets on another domain
If you do this once, the console is fine. If you do it every time a site catches your eye, let a tool do the counting and merging for you:
Free toolComing soonDesign system extractorExtract colors, type, spacing and shadows in one pass, and export them as CSS variables, Tailwind config or JSON. Free toolComing soonColor palette extractorGet the full color scheme from any webpage like backgrounds, text, borders, shadows and gradients and add to your own library as HEX, RGB and HSL.Should you copy another site's design system?
Use it as a reference, not a clone. A spacing grid, a type scale or a neutral palette isn't unique to anyone, and learning from them is how most designers get good. A site's logo, illustrations, photography and copy are its brand, and those aren't yours to take. The best result usually comes from extracting two or three systems you admire and combining them into something that's your own.