WCAG 2.1 color contrast compliance checker for frontend projects. Statically analyzes design system tokens and React/Next.js components against AA and AAA contrast thresholds — without running the application.
- Audits CSS custom property pairs (
--primary/--primary-foreground) for contrast compliance - Scans TSX/JSX components for foreground/background color pairs via AST parsing
- Resolves Tailwind classes, CSS variables, inline styles, and the default Tailwind v3 palette
- Builds a cross-file component graph to detect inherited background colors
- Supports hex, rgb, hsl, oklch, named colors, and CSS variable references
- Checks both light and dark themes
Requires Rust:
cargo install --git https://github.com/suleymanozkeskin/wcag-doctor.git# Audit design system tokens
wcag-doctor --system --css src/app/globals.css
# Scan a component directory
wcag-doctor --dir src/components --css src/app/globals.css
# JSON output for CI
wcag-doctor --system --css src/app/globals.css --json
# Check only dark theme at AAA level
wcag-doctor --system --css src/app/globals.css --theme dark --level aaaThis tool ships as a Claude skill so Claude can run contrast audits automatically when relevant.
In Claude Code, run:
/plugin marketplace add suleymanozkeskin/wcag-doctor
/plugin install wcag-doctor@wcag-doctor
- Download the
skill/wcag-doctor/folder from this repo - Zip it
- Go to Settings > Capabilities > Skills and upload the zip
Copy the skill into your repo so all team members get it:
cp -r /tmp/wcag-doctor/skill/wcag-doctor .claude/skills/wcag-doctorMIT