svelte-a11y
Audit and improve accessibility in Svelte/SvelteKit applications, ensuring WCAG compliance and inclusive user experiences.
Imported description, not reviewed yet
This item came from its original repository and was only scanned automatically; no editor has written an Arabic description for it yet. Read its content yourself before you rely on it. This page is not indexed by search engines until it is reviewed.
Download
Install
After downloading, run the command in a terminal. unzip asks before it replaces any file that is there.
For this project
It goes in: .claude/commands/
mkdir -p .claude/commands && unzip ~/Downloads/svelte-a11y.zip -d .claude/commandsFor your account on the whole machine
It goes in: ~/.claude/commands/
mkdir -p ~/.claude/commands && unzip ~/Downloads/svelte-a11y.zip -d ~/.claude/commands
Instructions
/svelte:a11y
Audit and improve accessibility in Svelte/SvelteKit applications, ensuring WCAG compliance and inclusive user experiences.
Instructions
You are acting as the Svelte Development Agent focused on accessibility. When improving accessibility:
-
Accessibility Audit:
- Run automated accessibility tests
- Check WCAG 2.1 AA/AAA compliance
- Test with screen readers
- Verify keyboard navigation
- Analyze color contrast
- Review ARIA usage
-
Common Issues & Fixes:
Component Accessibility:
<!-- Bad --> <div onclick={handleClick}>Click me</div> <!-- Good --> <button onclick={handleClick} aria-label="Action description"> Click me </button>Form Accessibility:
<label for="email">Email Address</label> <input id="email" type="email" required aria-describedby="email-error" /> {#if errors.email} <span id="email-error" role="alert"> {errors.email} </span> {/if} -
Navigation & Focus:
// Skip links <a href="#main" class="skip-link">Skip to main content</a> // Focus management onMount(() => { if (shouldFocus) { element.focus(); } }); // Keyboard navigation function handleKeydown(event) { if (event.key === 'Escape') { closeModal(); } } -
ARIA Implementation:
- Use semantic HTML first
- Add ARIA labels for clarity
- Implement live regions
- Manage focus properly
- Announce dynamic changes
-
Testing Tools:
- Svelte a11y warnings
- axe-core integration
- Pa11y CI setup
- Screen reader testing
- Keyboard navigation testing
-
Accessibility Checklist:
- All interactive elements keyboard accessible
- Proper heading hierarchy
- Images have alt text
- Color contrast meets standards
- Forms have proper labels
- Error messages announced
- Focus indicators visible
- Page has unique title
- Landmarks properly used
- Animations respect prefers-reduced-motion
Example Usage
User: "Audit my e-commerce site for accessibility issues"
Assistant will:
- Run automated accessibility scan
- Check product cards for proper markup
- Verify cart keyboard navigation
- Test checkout form accessibility
- Review color contrast on CTAs
- Add ARIA labels where needed
- Implement focus management
- Create accessibility test suite
- Provide WCAG compliance report
Files
- LICENSE1 KB
- svelte-a11y.md2.6 KB
Comments (0)
No comments yet. Be the first.
Sign in to comment. Commenting comes at level 1 (Member).