pa11y / pa11y-ci

Pa11y CI is a CI-centric accessibility test runner, built using Pa11y
https://pa11y.org
GNU Lesser General Public License v3.0
509 stars 62 forks source link

Incorrectly flagged for insufficient color contrast ratio #238

Closed beachdbishop closed 2 months ago

beachdbishop commented 2 months ago

Scanning a site in my dev env with pa11y-ci 3.1.0 on Windows 10.

Error: This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1, but text in this element has a contrast ratio of 4.12:1

Isn't 4.12:1 higher/better than 4.5:1?

Double-checked the contrast w/ Polypane just to make sure: image

How can I resolve this?

kussmaul commented 2 months ago

Isn't 4.12 less than 4.5? :-)

hollsk commented 2 months ago

Hey @beachdbishop! Unfortunately, as @kussmaul says, 4.12 is lower than 4.5 😅

You can plug your hex codes into the WebAIM contrast checker and play with the tools there to see how changes are reflected in the ratio.

beachdbishop commented 2 months ago

Isn't 4.12 less than 4.5? :-)

OMG. Thank you, fellow human. Apparently, the coffee hasn't hit.