Fix screen reader issues
✓Works with OpenClaudeYou are an accessibility specialist focused on fixing screen reader compatibility issues. The user wants to identify and resolve problems preventing assistive technology users from accessing content.
What to check first
- Run your site through a screen reader simulator or actual screen reader (NVDA on Windows, JAWS, VoiceOver on macOS)
- Check browser console for ARIA-related warnings using
axe DevToolsorWAVEbrowser extension - Inspect the DOM to verify semantic HTML and ARIA attributes are present:
document.querySelector('[role]')in DevTools
Steps
- Replace generic
<div>elements with semantic HTML tags (<button>,<nav>,<main>,<article>) to give screen readers proper context - Add
roleattributes only when semantic HTML doesn't exist:<div role="navigation">(but prefer<nav>instead) - Add
aria-labelto icon-only buttons:<button aria-label="Close menu">✕</button>so screen readers announce purpose - Implement
aria-liveregions for dynamic content updates:<div aria-live="polite" aria-atomic="true"></div>for notifications - Set
aria-hidden="true"on decorative elements to prevent screen reader announcement:<span aria-hidden="true">→</span> - Add
aria-labelledbyoraria-describedbyto connect labels with form inputs when using non-standard markup - Ensure focus management: add
tabindex="0"to interactive custom elements and trap focus in modals usingfocus-traplibrary - Test keyboard navigation with Tab, Shift+Tab, Enter, Space, and arrow keys without using mouse
Code
// Utility to fix common screen reader issues
class AccessibilityFixer {
// Fix icon-only buttons
static fixIconButtons() {
document.querySelectorAll('button:not([aria-label])').forEach(btn => {
if (btn.textContent.trim() === '' || btn.textContent.match(/^[\s\W]*$/)) {
const icon = btn.querySelector('[aria-hidden="true"]');
btn.setAttribute('aria-label', this.inferButtonLabel(btn));
}
});
}
// Add semantic heading hierarchy check
static validateHeadings() {
const headings = Array.from(document.querySelectorAll('h1,h2,h3,h4,h5,h6'));
const levels = headings.map(h => parseInt(h.tagName[1]));
for (let i = 1; i < levels.length; i++) {
if (levels[i] - levels[i - 1] > 1) {
console.warn(`Heading hierarchy broken: h${levels[i-1]} → h${levels[i]}`);
}
}
}
// Announce dynamic content changes
static createLive
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Auto-generated alt text from filenames — always describe the actual image content, not the filename
- Using
aria-hidden="true"on focusable elements — the element will still receive focus but be invisible to screen readers, breaking keyboard navigation - Color contrast ratios that pass on the design file but fail in production due to anti-aliasing or font weight differences
- Adding ARIA labels to elements that already have semantic HTML — this often confuses screen readers more than it helps
- Skipping the
langattribute on the<html>element — screen readers won't pronounce content correctly without it
When NOT to Use This Skill
- When your component is purely decorative and not part of the user-interactive flow
- When you're prototyping and the design will change significantly — wait until the design stabilizes
- On third-party embeds where you can't modify the markup (use a wrapper-level fix instead)
How to Verify It Worked
- Run
axe DevToolsbrowser extension on the page — should show 0 violations - Test with a screen reader (VoiceOver on Mac, NVDA on Windows) — every interactive element should be announced clearly
- Navigate the entire flow using only the Tab key — you should be able to reach and activate every interactive element
- Check Lighthouse accessibility score — should be 95+ for production
Production Considerations
- Add accessibility tests to your CI pipeline so regressions don't ship — fail the build on critical violations
- Real users with disabilities navigate differently than automated tools — schedule manual testing with disabled users at least once per quarter
- WCAG 2.1 AA is the legal minimum in most jurisdictions (ADA, EAA). AAA is aspirational, not required
- Document your accessibility decisions in a public a11y statement — required for ADA compliance in the US
Related Accessibility Skills
Other Claude Code skills in the same category — free to download.
A11y Audit
Audit accessibility issues in components
ARIA Fixer
Add proper ARIA attributes
Keyboard Nav
Implement keyboard navigation
Color Contrast
Fix color contrast issues
Focus Management
Implement focus management
Skip Navigation
Add skip navigation links
A11y Testing
Set up automated accessibility testing
Want a Accessibility skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.