Deep extraction.
Any URL. Full system. Colors, type, spacing, motion, a11y, interactive states, exports.

designsnap crawls a live page with a headless browser, scans every element's computed styles, clusters values into tokens, scores the system's consistency, runs an accessibility audit, captures hover states, detects the spacing grid, and outputs to 5 formats in one command.

$ npx designsnap https://example.com --all click to copy

What it looks like

terminal
$ designsnap https://linear.app --all --preview --dark
designsnap v0.2.0
https://linear.app
Extraction complete
DESIGN.md → ./DESIGN.md
Preview → ./DESIGN-preview.html
Tailwind → ./DESIGN.tailwind.js
CSS vars → ./DESIGN.tokens.css
Style Dict → ./DESIGN.tokens.json
Figma Tokens → ./DESIGN.figma-tokens.json
Summary
18 colors · 3 fonts · 14 spacing · 5 components · 4 shadows
Score: 82/100 (color 90 · type 95 · space 72 · a11y 70)
Grid: 4px base (72% adherence)
Type scale: Major Third (1.25:1)
Color harmony: analogous
⚠ 3 contrast issues found
Breakpoints: 640px, 768px, 1024px, 1280px

How it works

Eight steps. No AI inference. No screenshot parsing. Reading what the browser actually rendered.

01
Load
Puppeteer opens
the URL
02
Wait
Dynamic content
+ fonts render
03
Scan
Every element's
computed styles
04
Parse
CSS vars, @font-face
@keyframes, @media
05
Simulate
Hover + focus
state changes
06
Cluster
Color distance
spacing grid
07
Score
Consistency
across 6 axes
08
Export
5 formats
one command

Consistency Score

Every extraction rates the design system's consistency across six dimensions. 0-100 per axis, averaged into an overall score. Helps you understand how systematic a design actually is before working with it.

design consistency · 82/100
Color
90
Typography
95
Spacing
72
Radius
80
Shadows
85
Accessibility
70

Color Analysis

Clustering groups similar hex values by Euclidean distance in RGB space. Role inference assigns semantic labels based on lightness, saturation, and usage context. Harmony detection identifies the palette type (monochromatic, complementary, analogous, triadic). Pairing validation tests every fg/bg combination for WCAG AA/AAA compliance.

color harmony · analogous
3 chromatic hues within 90° arc
accessible pairings
16.0:1 AA AAA
4.7:1 AA
3.8:1 fail

Grid System Detection

Spacing values from every padding, margin, and gap are tested against candidate base units (4px, 5px, 6px, 8px, 10px). The base with the highest adherence rate wins. Green bars = on grid. Red = off grid.

spacing grid · 8px base · 78% adherence

Interactive States

The cursor is programmatically moved over interactive elements. Style changes between default and hover states are captured as structured diffs. Hover the buttons below to see what designsnap records.

hover state capture
Primary action
Secondary
captured changes
background: #5e6ad2#6e7ae2
box-shadow: none0 4px 16px rgba(94,106,210,0.3)
transform: nonetranslateY(-1px)

Motion & Animation

Transition durations, easing functions, animated properties, and @keyframes are extracted from stylesheets and computed styles. Builds a complete motion vocabulary for the design system.

motion system
durations
150ms · 42 uses
200ms · 28 uses
300ms · 15 uses
easings
ease · 36 uses
ease-in-out · 22 uses
cubic-bezier · 8 uses
properties
all · 30 uses
opacity · 18 uses
transform · 12 uses

Accessibility Audit

Contrast ratios tested against WCAG 2.1 for every text element. Heading order validated. Landmark elements counted. Form labels checked. ARIA attributes inventoried. Focus styles detected.

a11y audit
Heading order: h1 → h2 → h3 (sequential)
Landmarks: header, main, footer, nav detected
Focus styles: :focus-visible rules found
!
3 contrast issues: secondary text on light surfaces below 4.5:1
!
2 images missing alt text
Form labels: 8 labeled, 0 unlabeled
Skip link: present

Export Formats

One extraction, five output formats. Use --all to generate everything at once.

DESIGN.md
14-section structured markdown with consistency score, a11y audit, and agent prompts
default output
Tailwind Config
Drop-in theme extension with colors, fonts, spacing, radius, shadows, screens
--tailwind
CSS Variables
Complete :root block with colors, type, spacing, radius, shadows, motion, opacity
--css
Style Dictionary
W3C-compatible design tokens JSON for style-dictionary pipelines
--tokens
Figma Tokens
Tokens Studio compatible JSON for syncing extracted tokens to Figma
--figma
Preview HTML
Visual catalog with score bars, color swatches, type samples, spacing blocks
--preview

Install

terminal
npm install -g designsnap
FlagDescriptionDefault
-o, --outputOutput file path./DESIGN.md
--previewGenerate visual preview HTMLfalse
--jsonOutput raw extracted datafalse
--darkExtract dark mode tokensfalse
--responsiveMulti-viewport extractionfalse
--no-statesSkip hover/focus simulationfalse
--wait <ms>Wait time for dynamic content3000
--tailwindExport Tailwind configfalse
--cssExport CSS custom propertiesfalse
--tokensExport Style Dictionary JSONfalse
--figmaExport Figma Tokens JSONfalse
--allExport all formatsfalse

Programmatic API

app.js
import { snap } from "designsnap"

const result = await snap("https://example.com", {
  wait: 3000,
  extractDark: true,
  multiViewport: true,
  extractStates: true,
})

result.markdown                  // DESIGN.md (14 sections)
result.data.consistencyScore     // { overall: 82, color: 90, ... }
result.data.colorHarmony         // { type: "analogous", ... }
result.data.gridSystem           // { base: 8, adherence: 78 }
result.data.scaleRatio           // { name: "Major Third", ratio: 1.25 }
result.data.accessibility        // { contrastIssues: [...], ... }
result.data.motionSystem         // { durations: {}, easings: {} }
result.data.interactiveStates    // { hover: [...], focus: [...] }
result.exports.tailwind          // Tailwind config string
result.exports.css               // CSS variables string
result.exports.styleDictionary   // Style Dictionary JSON
result.exports.figmaTokens       // Figma Tokens JSON

Framework Detection

designsnap scans CSS custom property naming patterns, class conventions, and meta tags to identify what framework or design system library a site is built with. Detects Tailwind, Bootstrap, Material UI, Chakra UI, Ant Design, Radix, shadcn/ui, Foundation, and Bulma with confidence scores.

detected frameworks
92%
Tailwind CSS
68%
shadcn/ui
signals: 14 --tw-* CSS vars, 6 --radius/--primary/--muted vars

System Completeness

Beyond consistency, designsnap checks 20 criteria that define a complete design system. Color roles, font pairs, type scale, heading hierarchy, spacing grid, component variants, motion tokens, dark mode, responsive breakpoints, focus styles, CSS variables, and icon system. You get a percentage and a checklist.

completeness · 85%
✓ Color palette defined
✓ Color roles assigned
✓ Primary font defined
✓ Secondary font defined
✓ Type scale 4+ sizes
✓ Heading hierarchy h1-h3
✓ Spacing scale 6+ values
✓ Consistent spacing grid
✓ Border radius system
✓ Shadow elevation system
✓ Button variants
✓ Input component
✓ Navigation component
✓ Motion system
✓ Responsive breakpoints
✓ Focus styles
✓ CSS custom properties
✗ Dark mode support
✗ Card component
✗ Icon system

Diff Mode

Compare two design system extractions side by side. Useful for competitive analysis, redesign tracking, or detecting design drift between staging and production.

diff.js
import { snapDiff } from "designsnap"

const result = await snapDiff("https://site-a.com", "https://site-b.com")

result.diffMarkdown              // structured diff as markdown
result.diffResult.summary        // { colorsAdded: 3, colorsRemoved: 1, ... }
result.diffResult.scores.overall // { a: 82, b: 75, delta: -7 }
result.diffResult.colors.added   // [{ hex: "#ff0000", role: "error" }]
result.diffResult.gridSystem     // { a: "8px (78%)", b: "4px (85%)" }

The diff covers colors, fonts, spacing, radii, shadows, components, breakpoints, grid system, consistency scores, and accessibility changes.

Disclaimer

Educational & Experimental Use Only

This tool is provided strictly for educational and experimental purposes. It reads publicly visible computed CSS values from rendered web pages, equivalent to what any browser's developer tools expose.

  • No proprietary code, assets, or non-public information is accessed
  • Extracted tokens represent publicly visible styling
  • No ownership of any visual identity or brand is claimed
  • Users are responsible for compliance with applicable terms of service
  • Does not bypass any access controls, authentication, or rate limiting
  • Output should not be used to create confusingly similar products or infringe trademarks

The author provides this tool as-is with no warranty. Use responsibly.