Common Accessibility
ASecurityThe form has three accessibility problems, but each has a direct fix: 1. Replace interactive `div` elements with native controls. Put them inside a real `<form>`, use `<input>` elements, and provide explicit programmatic labels: ```html <form aria-labelledby="login-heading"> <h1 id="login-heading">Sign in</h1> <label for="email">Email address</label> <input id="email" name="email" type="email" autocomplete="email" required aria-describedby="email-error"> <p id="email-error" role="alert" hidde...
- 584 stars
- 0 votes
- 0 copies
- 2 views
- Added September 5, 2026
Security analysis
100/100Pro scans all 11 files and shows the line behind each finding
npx -y skills add HoangNguyen0403/agent-skills-standard --skill common-accessibility --agent claude-codeAre you the author of Common Accessibility?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-common-accessibility-bd1bc72f)The form has three accessibility problems, but each has a direct fix:
1. Replace interactive `div` elements with native controls. Put them inside a real `<form>`, use `<input>` elements, and provide explicit programmatic labels:
```html
<form aria-labelledby="login-heading">
<h1 id="login-heading">Sign in</h1>
<label for="email">Email address</label>
<input id="email" name="email" type="email"
autocomplete="email" required
aria-describedby="email-error">
<p id="email-error" role="alert" hidden>Please enter a valid email address.</p>
<label for="password">Password</label>
<input id="password" name="password" type="password"
autocomplete="current-password" required
aria-describedby="password-error">
<p id="password-error" role="alert" hidden>Enter your password.</p>
<button type="submit">Sign in</button>
</form>
```
The actual error elements should be shown only when relevant; when shown, set the corresponding input’s `aria-invalid="true"`. Placeholder text can be an optional example or hint, but it is not a replacement for a persistent `<label>` because it disappears and has poor contrast.
2. Verify the blue submit button’s color combination rather than assuming blue is accessible. Normal button text needs at least a 4.5:1 contrast ratio against its background; the button’s boundary and other state indicators need sufficient non-text contrast. Do not use color alone to convey success or failure—include visible text or an icon with an accessible name.
3. Add a clearly visible keyboard focus style, preferably with `:focus-visible`, and do not remove the browser outline unless a replacement is provided:
```css
button:focus-visible,
input:focus-visible {
outline: 2px solid #123a70;
outline-offset: 2px;
}
```
The outline must have at least 3:1 contrast against adjacent colors and remain visible in every state. Keep the natural DOM/tab order, avoid positive `tabindex` values, and ensure all fields and the submit action work without a pointer.
Also check that the page has a logical heading structure and one main landmark, that validation changes are announced without excessive interruption, and that server-side errors are associated with the relevant control. Run axe-core with zero critical violations, then test the complete login flow by keyboard, with NVDA or VoiceOver, and at 200% zoom.
Files in this skill
- eval-1.baseline.md
- eval-1.with-skill.md
- eval-2.baseline.md
- eval-2.with-skill.md
- eval-3.baseline.md
- eval-3.with-skill.md
- trigger-1.md
- trigger-2.md
- trigger-3.md
- trigger-4.md
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.