Skip to content

Repository files navigation

β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—
β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•  β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•β•β•
          A U D I T O R

Lighthouse for design consistency

One command. 9 audit modules. A score from 0 to 100.

npm version npm downloads CI license snyk playwright website


What is this?

design-auditor opens any website in a real Chromium browser, inspects every element's computed styles, and scores design consistency across 9 modules β€” typography, colors, spacing, components, readability, images, links, headings, and breakpoints.

npx design-auditor https://stripe.com

Think of it as Lighthouse, but for your design system β€” not performance, not SEO, but the visual coherence of your product.

Tool What it checks
Lighthouse Performance, SEO, best practices
axe / WAVE Accessibility compliance
Stylelint CSS source code linting
design-auditor Design system consistency β€” the gap no one else fills

See it in action

Design Auditor Preview


Quick Start

# No installation needed
npx design-auditor https://stripe.com

# Audit only specific modules
npx design-auditor https://stripe.com --only colors,typography

# Local dev server
npx design-auditor http://localhost:3000 --local

# Save JSON report for CI
npx design-auditor https://stripe.com --save-report

Scoring

Every audit produces a weighted score from 0 to 100 with a letter grade:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                DESIGN AUDIT SCORE                β”‚
β”‚                                                  β”‚
β”‚          72 / 100  β€”  Grade B (Good)             β”‚
β”‚                                                  β”‚
β”‚  Typography        β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘  82   (weight 15%) β”‚
β”‚  Colors            β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘  60   (weight 20%) β”‚
β”‚  Rhythm & Spacing  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘  78   (weight 15%) β”‚
β”‚  Components        β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘  65   (weight 15%) β”‚
β”‚  Reading Width     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘  90   (weight 10%) β”‚
β”‚  Images            β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘  80   (weight 10%) β”‚
β”‚  Links             β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘  85   (weight  5%) β”‚
β”‚  Headings          β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  100  (weight  5%) β”‚
β”‚  Breakpoints       β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘  70   (weight  5%) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Grade Score Meaning
A 90-100 Excellent β€” consistent design system
B 75-89 Good β€” minor inconsistencies
C 60-74 Needs Work β€” visible design drift
D 40-59 Poor β€” significant inconsistencies
F 0-39 Critical β€” no design system detected

Use --save-report to track your score over time and catch design drift in CI.


9 Audit Modules

Typography weight: 15%

Good type is invisible. Bad type is everywhere.

  • Font family count (recommended: ≀ 3)
  • Unique font sizes and modular scale adherence
  • Line-height consistency across text elements
  • Outlier sizes that break the visual rhythm

Colors weight: 20%

A brand is not a logo. It's a consistent palette.

  • Unique color count across the entire page
  • Similar shade clustering using delta-E color science
  • Auto-detection of primary / secondary / accent colors by usage frequency
  • WCAG AA contrast validation for all text/background pairs
  • CSS variable coverage β€” are colors tokenized or hardcoded?

Vertical Rhythm & Spacing weight: 15%

The baseline grid is the heartbeat of a layout.

  • Rhythm unit detection (font-size x line-height)
  • Line-heights as multiples of the rhythm unit
  • 4px / 8px grid adherence for margins and paddings
  • Outlier spacing values like 13px, 17px, 22px

Components weight: 15%

Inconsistent buttons are a symptom of an inconsistent system.

  • Touch target sizes (minimum 44x44px per WCAG 2.5.5)
  • Button padding variations (recommended: ≀ 3 sizes β€” sm/md/lg)
  • :hover and :focus interactive states
  • Border-radius system (recommended: ≀ 5 values)
  • Box-shadow elevation levels and light direction consistency
  • Z-index organization and "magic numbers"

Reading Width weight: 10%

If a line is too long, the reader's eye has a hard time finding the next line.

  • Average line character count (optimal: 45-75 characters)
  • Percentage of text blocks within optimal reading width
  • Flags text containers that are too wide (>80 chars) or too narrow (<30 chars)

Images weight: 10%

Every image without alt text is a door slammed on a screen reader user.

  • Alt text coverage (error if >30% missing)
  • Aspect ratio consistency (recommended: ≀ 3 unique ratios)
  • Inconsistent ratios within component groups (e.g. cards with mixed image proportions)

Links weight: 5%

A link distinguished only by color is invisible to 8% of men.

  • WCAG 1.4.1 β€” links must not rely on color alone (needs underline or other indicator)
  • Link color consistency across the page
  • :visited state defined
  • :focus state for keyboard navigation (WCAG 2.4.7)

Headings weight: 5%

Headings are the table of contents your DOM never knew it had.

  • Exactly one <h1> per page
  • Logical heading order (no skipped levels like H2 β†’ H4)
  • Visual size hierarchy β€” higher-level headings must appear larger
  • Deep nesting warnings (excessive H5/H6 usage)

Breakpoints weight: 5%

A responsive design without a breakpoint system is just a flexible mess.

  • Known system detection (Bootstrap, Tailwind, etc.)
  • Breakpoint count (recommended: 4-6, error if >8)
  • Strategy check β€” mobile-first vs desktop-first vs mixed
  • Non-standard breakpoint values

Output

────────────────────────────────────────────────────────────
  TYPOGRAPHY
────────────────────────────────────────────────────────────
  βœ… Font families: 2 β€” OK
  ⚠️  Font sizes: 11 unique β€” recommended ≀ 8
     Found: 12px 14px 16px 18px 22px 24px 32px 40px 48px 56px 64px
  ❌ Line-heights: 22 unique β€” no vertical rhythm
     Too many line-height values β€” no baseline grid detected

  COLORS
────────────────────────────────────────────────────────────
  ❌ 54 unique colors found β€” recommended < 20
  ❌ 40 similar color pairs β€” palette can be consolidated
     β–ˆβ–ˆ #f0f6fc β‰ˆ β–ˆβ–ˆ #f6f8fa (Ξ”E=2.6)
     β–ˆβ–ˆ #24292f β‰ˆ β–ˆβ–ˆ #1f2328 (Ξ”E=2.9)
  βœ… Primary:   β–ˆβ–ˆ #79c0ff  (262 uses)
  βœ… Secondary: β–ˆβ–ˆ #59636e  (100 uses)
  βœ… Color balance: 63% / 24% / 2% β€” close to 60/30/10 rule

  COMPONENTS
────────────────────────────────────────────────────────────
  ❌ 28/50 buttons smaller than 44px touch target (56%)
     "Sign up" 101Γ—32px, "Explore" 94Γ—36px
  ⚠️  Buttons: 11 padding variations β€” recommended ≀ 3
  βœ… Interactive states: :hover and :focus present
  ❌ 12 unique border-radius values β€” recommended ≀ 5

────────────────────────────────────────────────────────────
  SCORE: 72 / 100 β€” Grade B (Good)
────────────────────────────────────────────────────────────

Every color is rendered as a live color swatch right in your terminal.


How it works

URL  β†’  Playwright opens a real Chromium browser
         β”‚
         β”œβ”€β”€ page.evaluate()  ←  runs inside the browser
         β”‚   └── getComputedStyle() on every element
         β”‚       returns actual rendered values
         β”‚
         β”œβ”€β”€ 9 Extractors collect raw data
         β”‚   β”œβ”€β”€ typography.ts     β€” fonts, sizes, line-heights
         β”‚   β”œβ”€β”€ colors.ts         β€” delta-E clustering, WCAG contrast
         β”‚   β”œβ”€β”€ rhythm.ts         β€” spacing, margins, grid detection
         β”‚   β”œβ”€β”€ components.ts     β€” buttons, shadows, z-index
         β”‚   β”œβ”€β”€ reading-width.ts  β€” line character counts
         β”‚   β”œβ”€β”€ images.ts         β€” alt text, aspect ratios
         β”‚   β”œβ”€β”€ links.ts          β€” states, color-only distinction
         β”‚   β”œβ”€β”€ headings.ts       β€” hierarchy, visual sizing
         β”‚   └── breakpoints.ts    β€” media query analysis
         β”‚
         β”œβ”€β”€ Rules engine evaluates violations (pass / warn / error)
         β”‚
         └── Score calculator β†’ weighted 0-100 score + grade

Unlike static CSS analysis, design-auditor uses a real browser β€” so it sees computed styles, not source code. It catches values injected by JavaScript, CSS custom properties resolved at runtime, and styles applied by third-party scripts.


Options

design-auditor <url> [options]

Arguments:
  url                    Website URL to audit

Options:
  --only <modules>       Run specific modules only
                         Values: typography, colors, spacing, components,
                         reading-width, images, links, headings, breakpoints
  --save-report          Save full report as JSON file
  --local                Optimize for local dev servers (disables networkidle)
  -V, --version          Show version number
  -h, --help             Show help

JSON Report

With --save-report, the full audit is saved as structured JSON β€” perfect for CI pipelines, dashboards, or tracking design drift over time.

{
  "url": "https://stripe.com",
  "date": "2026-02-27T10:00:00.000Z",
  "score": {
    "overall": 72,
    "grade": "B",
    "label": "Good"
  },
  "summary": {
    "pass": 7,
    "warn": 5,
    "error": 3
  },
  "modules": [
    {
      "name": "Colors",
      "score": 60,
      "weight": 20,
      "violations": [
        {
          "id": "too-many-colors",
          "severity": "error",
          "message": "54 unique colors found β€” recommended < 20",
          "hint": "A large palette makes maintenance harder..."
        }
      ]
    }
  ]
}

Design philosophy

A design system is a set of constraints. Audit tools should enforce them.

Most automated tools check if your site works (Lighthouse) or if it's accessible (axe). design-auditor checks if your site is consistent β€” the thing that's hardest to maintain as teams grow.

Based on established standards:


Installation

# Run without installing
npx design-auditor https://stripe.com

# Or install globally
npm install -g design-auditor
design-auditor https://stripe.com

Requirements: Node.js 20+


Contributing

Contributions are welcome! Whether it's a bug fix, a new audit rule, or an improvement to an existing module β€” open an issue or submit a PR.

git clone https://github.com/PashaSchool/design-auditor.git
cd design-auditor
npm install
npx playwright install chromium
npm run dev -- https://example.com

See open issues for ideas on where to start.


Limitations

  • Audits only the first page at the given URL (no multi-page crawl yet)
  • JavaScript-heavy SPAs may need a few seconds to fully render β€” use --local for dev servers
  • Media query analysis reads CSS source rules; dynamically injected media queries may be missed
  • Color extraction uses computed styles β€” colors set via canvas, svg, or background-image gradients are not captured
  • Contrast checking covers text on elements with an explicit background color; text over inherited/transparent backgrounds or images is skipped

Security

snyk

All dependencies are continuously scanned for vulnerabilities using Snyk.


License

MIT β€” use it, fork it, build on it.


Built with care for designers who care about consistency.

Read the story behind design-auditor on dev.to

About

Catch design inconsistencies before your users do. Audits any public URL in seconds.

Topics

Resources

Code of conduct

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages