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
+60-30Lines changed: 60 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,9 @@ description: Uses Chrome DevTools MCP for accessibility (a11y) debugging and aud
14
14
### 1. Browser Issues & Audits
15
15
16
16
Chrome automatically checks for common accessibility problems. Use `list_console_messages` to check for these native audits first:
17
-
-`types`: `["issue"]`
18
-
-`includePreservedMessages`: `true` (to catch issues that occurred during page load)
17
+
18
+
-`types`: `["issue"]`
19
+
-`includePreservedMessages`: `true` (to catch issues that occurred during page load)
19
20
20
21
This often reveals missing labels, invalid ARIA attributes, and other critical errors without manual investigation.
21
22
@@ -35,14 +36,24 @@ The accessibility tree exposes the heading hierarchy and semantic landmarks.
35
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`:
2. Use the `press_key` tool with`"Tab"` or `"Shift+Tab"` to move focus.
61
77
3. Re-run the script in step 1 to ensure focus moved to the expected next interactive element.
@@ -66,22 +82,25 @@ Testing "keyboard traps" and proper focus management without visual feedback rel
66
82
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`:
67
83
68
84
```javascript
69
-
(el) => {
85
+
el => {
70
86
const rect = el.getBoundingClientRect();
71
-
return {width: rect.width, height: rect.height};
72
-
}
87
+
return {width: rect.width, height: rect.height};
88
+
};
73
89
```
74
-
*Pass the element's `uid` from the snapshot as an argument to the tool.*
90
+
91
+
_Pass the element's `uid` from the snapshot as an argument to the tool._
75
92
76
93
### 6. Color Contrast
77
94
78
-
To verify color contrast ratios without the DevTools UI, use `evaluate_script` to compute the relative luminance of the text (`color`) and background (`backgroundColor`).
95
+
To verify color contrast ratios without the DevTools UI, use `evaluate_script` to compute the relative luminance of the text (`color`) and background (`backgroundColor`).
79
96
80
97
```javascript
81
-
(el) => {
98
+
el => {
82
99
function getRGB(colorStr) {
83
100
const match = colorStr.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
84
-
return match ? [parseInt(match[1]), parseInt(match[2]), parseInt(match[3])] : [255, 255, 255];
If standard a11y queries fail or the `evaluate_script` snippets return unexpected results:
126
156
127
-
* **Visual Inspection**: If automated scripts cannot determine contrast (e.g., text over gradient images or complex backgrounds), use `take_screenshot` to capture the element. While models cannot measure exact contrast ratios from images, they can visually assess legibility and identifying obvious issues.
157
+
- **Visual Inspection**: If automated scripts cannot determine contrast (e.g., text over gradient images or complex backgrounds), use `take_screenshot` to capture the element. While models cannot measure exact contrast ratios from images, they can visually assess legibility and identifying obvious issues.
0 commit comments