Skip to content

Commit 739ffa8

Browse files
committed
docs: Improve color contrast verification guidance by prioritizing native checks and clarifying script limitations.
1 parent 97a4047 commit 739ffa8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

skills/a11y-debugging/SKILL.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,14 @@ _Pass the element's `uid` from the snapshot as an argument to the tool._
8181

8282
### 6. Color Contrast
8383

84-
To verify color contrast ratios without the DevTools UI, use `evaluate_script` to compute the relative luminance of the text (`color`) and background (`backgroundColor`).
84+
To verify color contrast ratios, start by checking for native accessibility issues:
85+
86+
1. Call `list_console_messages` with `types: ["issue"]`.
87+
2. Look for "Low Contrast" issues in the output.
88+
89+
If native audits do not report issues (which may happen in some headless environments) or if you need to check a specific element manually, you can use the following script as a fallback approximation.
90+
91+
**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`.
8592

8693
```javascript
8794
el => {

0 commit comments

Comments
 (0)