You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: skills/a11y-debugging/SKILL.md
+42-32Lines changed: 42 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,25 +35,29 @@ The accessibility tree exposes the heading hierarchy and semantic landmarks.
35
35
2. Ensure interactive elements have an accessible name (e.g., a button should not just say `""` if it only contains an icon).
36
36
3.**Orphaned Inputs**: Verify that all form inputs have associated labels. Use `evaluate_script` to check for inputs missing `id` (for `label[for]`) or `aria-label`:
@@ -71,6 +75,7 @@ Testing "keyboard traps" and proper focus management without visual feedback rel
71
75
According to web.dev, tap targets should be at least 48x48 pixels with sufficient spacing. Since the accessibility tree doesn't show sizes, use `evaluate_script`:
72
76
73
77
```javascript
78
+
// Usage in console: copy, paste, and call with element: fn(element)
74
79
el => {
75
80
const rect = el.getBoundingClientRect();
76
81
return {width: rect.width, height: rect.height};
@@ -91,6 +96,7 @@ If native audits do not report issues (which may happen in some headless environ
91
96
**Note**: This script uses a simplified algorithm and may not account for transparency, gradients, or background images. For production-grade auditing, consider injecting `axe-core`.
92
97
93
98
```javascript
99
+
// Usage in console: copy, paste, and call with element: fn(element)
94
100
el => {
95
101
function getRGB(colorStr) {
96
102
const match = colorStr.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
@@ -130,20 +136,24 @@ _Pass the element's `uid` to test the contrast against WCAG AA (4.5:1 for normal
130
136
Verify document-level accessibility settings often missed in component testing:
131
137
132
138
```javascript
133
-
() => {
134
-
return {
135
-
lang:
136
-
document.documentElement.lang ||
137
-
'MISSING- Screen readers need thisfor pronunciation',
138
-
title: document.title || 'MISSING- Required for context',
0 commit comments