accessibility-contrast-audit
[Design System] Quantitative accessibility audit for UI - contrast ratios, font sizes, tap targets, heading hierarchy. Use when (1) checking WCAG color contrast compliance, (2) auditing text sizes for readability, (3) validating touch/click target sizes, (4) reviewing heading structure and landmarks, (5) user asks to 'check accessibility', 'audit contrast', 'WCAG compliance', or 'a11y check'.
When & Why to Use This Skill
This Claude skill automates quantitative accessibility audits for user interfaces, ensuring strict compliance with WCAG 2.1 standards. It provides a comprehensive analysis of UI elements, including color contrast ratios, font sizes, touch target dimensions, and semantic heading hierarchies to enhance digital inclusivity and user experience.
Use Cases
- WCAG Compliance Audit: Automatically verify if web or mobile interfaces meet Level AA or AAA standards for color contrast and text readability to avoid legal and usability risks.
- Design System Validation: Audit design tokens and UI components during the development phase to catch accessibility regressions like low-contrast text or insufficient hit areas.
- Semantic Structure Review: Evaluate heading hierarchies and landmarks to ensure logical document flow and optimal compatibility with screen readers.
- Mobile Usability Testing: Validate that touch targets and click areas meet the minimum 44×44px requirement for improved accessibility on mobile devices.
- Automated Quality Assurance: Integrate quantitative accessibility checks into the QA workflow to identify 'text-too-small' warnings and 'missing-alt' errors before deployment.
| name | accessibility-contrast-audit |
|---|---|
| description | "[Design System] Quantitative accessibility audit for UI - contrast ratios, font sizes, tap targets, heading hierarchy. Use when (1) checking WCAG color contrast compliance, (2) auditing text sizes for readability, (3) validating touch/click target sizes, (4) reviewing heading structure and landmarks, (5) user asks to 'check accessibility', 'audit contrast', 'WCAG compliance', or 'a11y check'." |
Accessibility & Contrast Audit
Quantitative accessibility checks for contrast, font size, hit areas, and semantic structure.
Quick Start
python3 scripts/audit_accessibility.py --source src/ --tokens tokens.json
WCAG Standards Reference
| Criterion | Level AA | Level AAA |
|---|---|---|
| Normal text contrast | 4.5:1 | 7:1 |
| Large text contrast (18px+ or 14px bold) | 3:1 | 4.5:1 |
| UI components/graphics | 3:1 | 3:1 |
| Minimum touch target | 44×44px | 44×44px |
| Minimum font size (body) | 16px | 16px |
Problem Types
| Type | Severity | Description |
|---|---|---|
low-contrast |
error | Text/background contrast below WCAG threshold |
text-too-small |
warning | Font size below recommended minimum |
hit-area-too-small |
warning | Touch/click target below 44×44px |
heading-skip |
warning | Heading levels skipped (h1→h3) |
missing-alt |
error | Image missing alt text |