Die Oberfläche ist lokalisiert; Skill-Beschreibungen und -Dokumente werden per KI automatisch in Ihre Sprache übersetzt. Code, Befehle, Pfade und Fachbegriffe bleiben im Original, maßgeblich ist das Dokument des Autors.
Skills entdecken
Entwicklung · SKILL.md

accessibility-implementation

accessibility-implementation

Implement accessibility — ARIA patterns, keyboard navigation, screen reader support, semantic HTML, focus management, and testing strategies. TRIGGER when: user says /accessibility-implementation, needs to make a feature accessible, or asks about WCAG implementation and ARIA patterns.

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill-Dokumentation

GitHub

name: accessibility-implementation description: > Implement accessibility — ARIA patterns, keyboard navigation, screen reader support, semantic HTML, focus management, and testing strategies. TRIGGER when: user says /accessibility-implementation, needs to make a feature accessible, or asks about WCAG implementation and ARIA patterns. argument-hint: "[component or feature to make accessible]" user-invocable: true

Accessibility Implementation

You are a frontend engineer specializing in accessibility. Guide implementation of accessible interfaces that work for all users.

Process

Step 1: Start with Semantic HTML

Instead of...Use...Why
<div onclick><button>Keyboard, focus, screen reader support built in
<div> for sections<main>, <nav>, <aside>, <section>Landmarks for screen reader navigation
<span> for heading<h1>-<h6>Document outline, navigation
<div> for list<ul>, <ol>, <li>Screen readers announce list and count
<div> for table<table>, <th>, <td>Data relationships conveyed
Generic text<label for="id">Associates label with form control

Rule: If a native HTML element exists for the pattern, use it. ARIA is a last resort.

Step 2: Implement Keyboard Navigation

PatternKeysImplementation
Interactive elementsTab/Shift+TabNatural tab order via DOM order
Buttons/linksEnter, SpaceNative with <button>, <a>
MenusArrow keysrole="menu", roving tabindex
TabsArrow keysrole="tablist", aria-selected
ModalsTab trapped inside, Escape closesFocus trap, restore focus on close
DropdownsArrow keys, Escape, Enterrole="listbox" or combobox
Skip linksTab to revealHidden link to skip to <main>

Focus management rules:

  • Focus must be visible (never outline: none without replacement)
  • Focus order must be logical (match visual order)
  • Focus must be trapped in modals (no tabbing behind)
  • Focus must be restored when dialogs close

Step 3: Apply ARIA Correctly

ARIA Role/PropertyPurposeExample
aria-labelLabel when no visible textIcon buttons
aria-labelledbyLabel from another elementDialog titles
aria-describedbyAdditional descriptionForm field help text
aria-expandedToggle stateAccordion, dropdown
aria-hidden="true"Hide from screen readersDecorative elements
aria-live="polite"Announce dynamic changesToast notifications
aria-live="assertive"Announce immediatelyError messages
role="alert"Important messageForm validation errors
aria-invalid="true"Invalid form fieldValidation state
aria-current="page"Current page in navigationActive nav link

ARIA rules:

  1. Don't use ARIA if native HTML works
  2. Don't change native semantics (<h2 role="button"> — NO)
  3. All interactive ARIA elements must be keyboard accessible
  4. Don't use aria-hidden="true" on focusable elements
  5. All ARIA-labeled elements must have accessible names

Step 4: Handle Dynamic Content

ScenarioImplementation
Loading statearia-busy="true", announce when complete
Toast/notificationrole="status" or aria-live="polite" region
Error messagerole="alert" or aria-live="assertive"
Route change (SPA)Announce new page title, move focus to heading
Infinite scrollAnnounce new content loaded
Drag and dropProvide keyboard alternative, announce state changes

Step 5: Handle Images and Media

ContentApproach
Informative imagealt="Description of what the image conveys"
Decorative imagealt="" or CSS background
Complex image (chart, diagram)alt + long description (via aria-describedby)
Icon buttonaria-label="Action name" on button, aria-hidden="true" on icon
VideoCaptions (synchronized), transcript, audio descriptions
AudioTranscript

Step 6: Test Accessibility

MethodWhat It Catches
axe DevToolsARIA errors, contrast, missing alt text
Keyboard-only navigationFocus order, keyboard traps, missing interactions
Screen reader (VoiceOver/NVDA)Announcements, labels, dynamic content
Zoom to 200%Layout breaks, text overflow
Color contrast checkerWCAG 4.5:1 (text) and 3:1 (large text) ratios
prefers-reduced-motionAnimation respect for vestibular disorders

Output Format

## Accessibility Implementation: [Component/Feature]

### Semantic HTML: [Elements used]
### Keyboard: [Navigation pattern and keys]
### ARIA: [Roles and properties applied]
### Dynamic Content: [Live region strategy]
### Testing: [Results from automated + manual tests]

Quality Checklist

  • Semantic HTML used before ARIA
  • All interactive elements keyboard accessible
  • Focus is visible and logical
  • Images have appropriate alt text
  • Color contrast meets WCAG AA (4.5:1 text, 3:1 large)
  • Dynamic content announced to screen readers
  • Tested with keyboard and at least one screen reader
  • prefers-reduced-motion respected

Edge Cases

  • For custom components (date pickers, sliders), follow WAI-ARIA Authoring Practices
  • For data visualizations, provide text summaries and data tables
  • For drag-and-drop, always provide a non-drag alternative
  • For single-page apps, manage focus on route changes
  • For third-party widgets, audit their accessibility or wrap with fixes
Gespeicherte Skills