a11y-checker

Accessibility audit for CSS covering focus styles, color contrast, text sizing, screen reader support, and WCAG compliance. Provides actionable fixes. Use when auditing accessibility or fixing a11y issues.

16 stars

Best use case

a11y-checker is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Accessibility audit for CSS covering focus styles, color contrast, text sizing, screen reader support, and WCAG compliance. Provides actionable fixes. Use when auditing accessibility or fixing a11y issues.

Teams using a11y-checker should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/a11y-checker/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/testing-security/a11y-checker/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/a11y-checker/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How a11y-checker Compares

Feature / Agenta11y-checkerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Accessibility audit for CSS covering focus styles, color contrast, text sizing, screen reader support, and WCAG compliance. Provides actionable fixes. Use when auditing accessibility or fixing a11y issues.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Accessibility Checker Skill

This skill performs comprehensive CSS accessibility audits based on WCAG 2.2 guidelines. I'll identify issues and provide specific, actionable fixes to make your styles more accessible.

## What I Check

### Visual Accessibility
- Color contrast ratios (text, UI components)
- Text sizing and readability
- Focus indicators
- Visual hierarchy
- Spacing and target sizes

### Motion & Animation
- Reduced motion support
- Animation safety (no seizure triggers)
- Auto-playing content
- Parallax effects

### Interaction
- Keyboard navigation
- Focus management
- Interactive element states
- Touch target sizes

### Screen Readers
- Visually hidden but accessible content
- Display/visibility usage
- Content order
- Skip links

## WCAG 2.2 Guidelines I Follow

### Level A (Must Have)
- **1.4.1**: Color not sole indicator
- **2.1.1**: Keyboard accessible
- **2.4.1**: Skip navigation
- **3.2.1**: Consistent on focus

### Level AA (Should Have)
- **1.4.3**: Contrast minimum (4.5:1)
- **1.4.11**: Non-text contrast (3:1)
- **2.4.7**: Focus visible
- **2.5.5**: Target size (44x44px)

### Level AAA (Best Practice)
- **1.4.6**: Contrast enhanced (7:1)
- **1.4.8**: Visual presentation
- **2.4.8**: Location indication

## Common Issues & Fixes

### 1. Missing Focus Indicators

#### ❌ Problem
```css
/* Removes default focus outline */
button:focus {
  outline: none;
}

/* No visible focus indicator */
.link:focus {
  text-decoration: underline;
}
```

#### ✓ Solution
```css
/* Clear, visible focus indicator */
button:focus-visible {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* High contrast focus ring */
.link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  text-decoration: underline;
}

/* Fallback for browsers without :focus-visible */
button:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

button:focus:not(:focus-visible) {
  outline: none;
}
```

### 2. Insufficient Color Contrast

#### ❌ Problem
```css
/* 2.85:1 contrast - fails AA */
.text-muted {
  color: #999999;
  background: #ffffff;
}

/* 3.2:1 contrast - fails AA for normal text */
.button {
  color: #3b82f6;
  background: #ffffff;
}
```

#### ✓ Solution
```css
/* 7.03:1 contrast - passes AAA */
.text-muted {
  color: #666666;
  background: #ffffff;
}

/* 7.02:1 contrast - passes AAA */
.button {
  color: #2563eb;
  background: #ffffff;
}

/* Alternative: Use for large text only */
.large-text {
  font-size: 18px;  /* or 14px bold */
  color: #3b82f6;   /* 4.52:1 - passes AA for large text */
}
```

### 3. Tiny Touch Targets

#### ❌ Problem
```css
/* 20x20px - too small */
.icon-button {
  width: 20px;
  height: 20px;
  padding: 0;
}
```

#### ✓ Solution
```css
/* 44x44px - meets WCAG 2.5.5 */
.icon-button {
  width: 44px;
  height: 44px;
  padding: 12px;  /* 20px icon + 12px padding each side */
}

/* Or use minimum size */
.icon-button {
  min-width: 44px;
  min-height: 44px;
  padding: 0.75rem;
}
```

### 4. No Reduced Motion Support

#### ❌ Problem
```css
/* Animated without considering preferences */
.animated {
  animation: spin 2s infinite;
  transition: all 0.5s ease;
}
```

#### ✓ Solution
```css
/* Respects user preferences */
.animated {
  animation: spin 2s infinite;
  transition: all 0.5s ease;
}

@media (prefers-reduced-motion: reduce) {
  .animated {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}

/* Or completely remove animations */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-play-state: paused !important;
    transition-duration: 0.01ms !important;
  }
}
```

### 5. Hidden from Screen Readers

#### ❌ Problem
```css
/* Hidden from everyone including screen readers */
.error-message {
  display: none;
}

.announcement {
  visibility: hidden;
}
```

#### ✓ Solution
```css
/* Visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Hidden until shown (keeps in DOM) */
.error-message {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.error-message.visible {
  position: static;
  opacity: 1;
}
```

### 6. Small Text

#### ❌ Problem
```css
/* 10px - too small to read */
.caption {
  font-size: 10px;
}

/* Fixed pixel sizes don't scale */
body {
  font-size: 14px;
}
```

#### ✓ Solution
```css
/* Minimum 12px, uses relative units */
.caption {
  font-size: 0.75rem;  /* 12px if root is 16px */
}

/* Uses relative units for scalability */
body {
  font-size: 1rem;  /* 16px default, scales with user preferences */
}

.small {
  font-size: 0.875rem;  /* 14px */
}

/* Or use clamp for fluid sizing */
body {
  font-size: clamp(1rem, 2vw, 1.125rem);
}
```

### 7. Insufficient Line Height

#### ❌ Problem
```css
/* 1.1 line height - too tight */
.text {
  line-height: 1.1;
}
```

#### ✓ Solution
```css
/* 1.5 line height - WCAG recommendation */
.text {
  line-height: 1.5;
}

/* Adjust for different text sizes */
.heading {
  line-height: 1.2;  /* Tighter for large text */
}

.body {
  line-height: 1.5;  /* Normal for body text */
}

.caption {
  line-height: 1.4;  /* Slightly tighter for small text */
}
```

### 8. CSS-Only Interactions

#### ❌ Problem
```css
/* Hover-only dropdown - not keyboard accessible */
.nav-item:hover .dropdown {
  display: block;
}

/* CSS-only toggle - not accessible */
#toggle:checked + .content {
  display: block;
}
```

#### ✓ Solution
```css
/* Keyboard accessible dropdown */
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  display: block;
}

/* Or better: use JavaScript for complex interactions */

/* For toggle, ensure keyboard access */
.toggle-button:focus + .content,
.toggle-button[aria-expanded="true"] + .content {
  display: block;
}
```

## Accessibility Audit Checklist

### Color & Contrast
- [ ] Text has 4.5:1 contrast (AA) or 7:1 (AAA)
- [ ] Large text has 3:1 contrast (AA) or 4.5:1 (AAA)
- [ ] UI components have 3:1 contrast
- [ ] Focus indicators have 3:1 contrast
- [ ] Information not conveyed by color alone

### Typography
- [ ] Base font size at least 16px
- [ ] Line height at least 1.5 for body text
- [ ] Text can be resized to 200% without loss
- [ ] Max line length 70-80 characters
- [ ] Sufficient letter and word spacing

### Focus & Keyboard
- [ ] All interactive elements keyboard accessible
- [ ] Visible focus indicators on all elements
- [ ] Focus order follows logical reading order
- [ ] No keyboard traps
- [ ] Skip navigation links available

### Touch & Interaction
- [ ] Touch targets at least 44x44px
- [ ] Adequate spacing between clickable elements
- [ ] Hover states also have focus states
- [ ] No hover-only interactions

### Motion & Animation
- [ ] Respects prefers-reduced-motion
- [ ] No auto-playing animations
- [ ] No flashing/strobing (3+ times per second)
- [ ] Animations can be paused

### Screen Readers
- [ ] Important content not hidden with display:none
- [ ] Decorative images hidden with CSS
- [ ] Content order makes sense
- [ ] Visually hidden text uses proper technique

## Complete Accessible Component Example

```css
/* Accessible button component */
.button {
  /* Size & spacing */
  min-width: 44px;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;  /* 16px */

  /* Contrast */
  background: #2563eb;  /* 7.02:1 on white */
  color: white;         /* 9.52:1 on button bg */
  border: 2px solid transparent;

  /* Typography */
  font-weight: 600;
  line-height: 1;
  text-align: center;

  /* Visual */
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Hover state */
.button:hover {
  background: #1d4ed8;  /* Darker, higher contrast */
  transform: translateY(-1px);
}

/* Focus state */
.button:focus-visible {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* Active state */
.button:active {
  transform: translateY(0);
}

/* Disabled state */
.button:disabled {
  background: #93c5fd;
  color: #1e40af;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .button {
    transition-duration: 0.01ms;
  }

  .button:hover {
    transform: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .button {
    border-color: currentColor;
  }
}
```

## Testing Tools I Recommend

- **Chrome DevTools** - Lighthouse accessibility audit
- **axe DevTools** - Browser extension for accessibility testing
- **WAVE** - Web accessibility evaluation tool
- **Color Contrast Analyzer** - Desktop tool for contrast checking
- **Keyboard testing** - Navigate with Tab, Arrow keys, Enter, Escape
- **Screen readers** - NVDA (Windows), JAWS (Windows), VoiceOver (Mac/iOS)

## Example Usage

**You**: "Audit this button for accessibility issues"

```css
.button {
  font-size: 12px;
  padding: 5px 10px;
  color: #999;
  background: white;
  border: 1px solid #ccc;
}

.button:focus {
  outline: none;
}
```

**I'll respond**:

### Issues Found:

1. **🔴 CRITICAL: No focus indicator**
   - WCAG 2.4.7 (Level AA)
   - Fix: Add visible outline on :focus-visible

2. **🔴 CRITICAL: Insufficient contrast**
   - Color #999 on white = 2.85:1 (fails 4.5:1 requirement)
   - WCAG 1.4.3 (Level AA)
   - Fix: Use #666 for 5.74:1 contrast

3. **🟠 IMPORTANT: Small touch target**
   - 25x18px (estimated)
   - WCAG 2.5.5 recommends 44x44px
   - Fix: Increase padding

4. **🟠 IMPORTANT: Small text size**
   - 12px may be difficult to read
   - Fix: Use at least 14px (0.875rem) or 16px (1rem)

### Corrected Code:
```css
.button {
  /* Size */
  min-width: 44px;
  min-height: 44px;
  padding: 0.75rem 1.5rem;

  /* Typography */
  font-size: 1rem;  /* 16px */
  font-weight: 500;

  /* Colors - AAA compliant */
  color: #1f2937;  /* 14.07:1 on white */
  background: white;
  border: 2px solid #6b7280;  /* 5.77:1 on white */

  /* Interaction */
  cursor: pointer;
  transition: all 0.2s ease;
}

.button:hover {
  border-color: #374151;
  background: #f9fafb;
}

.button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition-duration: 0.01ms;
  }
}
```

## Just Ask!

Request an accessibility audit:
- "Check this CSS for accessibility issues"
- "Audit my button styles"
- "Review focus indicators"
- "Check color contrast"
- "Verify WCAG compliance"

I'll identify problems and provide fixes!

Related Skills

claude-a11y-audit

16
from diegosouzapw/awesome-omni-skill

Use when reviewing UI diffs, accessibility audits, or flaky UI tests to catch a11y regressions, semantic issues, keyboard/focus problems, and to recommend minimal fixes plus role-based test selectors.

aws-compliance-checker

16
from diegosouzapw/awesome-omni-skill

Automated compliance checking against CIS, PCI-DSS, HIPAA, and SOC 2 benchmarks

accessibility-checker

16
from diegosouzapw/awesome-omni-skill

Validate WCAG 2.1 Level AA compliance and accessibility best practices. Use when performing accessibility audits and WCAG certification.

a11y-specialist

16
from diegosouzapw/awesome-omni-skill

Expert in web accessibility (WCAG 2.1/2.2 AA/AAA compliance), ARIA patterns, keyboard navigation, screen reader testing, color contrast, focus management, and automated accessibility testing

a11y-ally

16
from diegosouzapw/awesome-omni-skill

Comprehensive WCAG accessibility auditing with multi-tool testing (axe-core + pa11y + Lighthouse), TRUE PARALLEL execution with Promise.allSettled, graceful degradation, retry with backoff, context-aware remediation, learning integration, and video accessibility. Uses 3-tier browser cascade: Vibium → agent-browser → Playwright+Stealth.

applying-a11y-standards

16
from diegosouzapw/awesome-omni-skill

Rules for ensuring Accessibility (a11y) across the Tourly app. Use to build inclusive interfaces.

skill-sync-checker

16
from diegosouzapw/awesome-omni-skill

Detects content drift between skill files and their source documents. Helps maintain skills that are derived from other documentation by comparing content and flagging outdated sections.

a11y-checker-ci

16
from diegosouzapw/awesome-omni-skill

Adds comprehensive accessibility testing to CI/CD pipelines using axe-core Playwright integration or pa11y-ci. Automatically generates markdown reports for pull requests showing WCAG violations with severity levels, affected elements, and remediation guidance. This skill should be used when implementing accessibility CI checks, adding a11y tests to pipelines, generating accessibility reports, enforcing WCAG compliance, automating accessibility scans, or setting up PR accessibility gates. Trigger terms include a11y ci, accessibility pipeline, wcag ci, axe-core ci, pa11y ci, accessibility reports, a11y automation, accessibility gate, compliance check.

unsafe-checker

16
from diegosouzapw/awesome-omni-skill

CRITICAL: Use for unsafe Rust code review and FFI. Triggers on: unsafe, raw pointer, FFI, extern, transmute, *mut, *const, union, #[repr(C)], libc, std::ffi, MaybeUninit, NonNull, SAFETY comment, soundness, undefined behavior, UB, safe wrapper, memory layout, bindgen, cbindgen, CString, CStr, 安全抽象, 裸指针, 外部函数接口, 内存布局, 不安全代码, FFI 绑定, 未定义行为

pyright-type-checker

16
from diegosouzapw/awesome-omni-skill

Pyright fast Python type checker from Microsoft with VS Code integration and strict type checking modes

gradle-dependency-checker

16
from diegosouzapw/awesome-omni-skill

Executes Gradle dependency check commands, retrieves and analyzes dependency trees, and extracts version information for key dependencies such as kotlin/kotlinx/skiko/androidx. Use when users need to check Gradle project dependency versions or analyze dependency relationships.

async-await-checker

16
from diegosouzapw/awesome-omni-skill

Automatically applies when writing Python functions that call async operations. Ensures proper async/await pattern usage (not asyncio.run) to prevent event loop errors.