-
Notifications
You must be signed in to change notification settings - Fork 791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Insufficient color contrast" incorrectly raised when color-scheme: dark
is set
#3605
Comments
Thanks for the issue. We'll look into how best to handle this. (for myself: one possibility is to add an element to the DOM with |
Hi! This turned out to be the cause of some false positives this week with a Cypress component test that uses For this situation I'm recommending they explicitly set :root {
background-color: Canvas;
} Would doing something similar with just CSS work for the rule itself? |
We haven't discussed internally how we want to handle this yet. I know we try not to modify the DOM by adding / modifying elements, so adding an element with the background-color may not work. |
Got it, thank you. I'll document here if we see this more often, or if spot a way to get the true background color the browser is using in |
Product
axe Extension
Product Version
extension: v4.33.2 axe-core: v4.4.2
Lastest Version
Issue Description
Expectation
No contrast ratio issues reported when
color-scheme: dark
set on root element and contrast ratio is sufficient.Actual
Contrast ratio issues are incorrectly reported.
How to Reproduce
Use the following HTML (no styles are applied):
In the console, the
h1
element's background and text color are computed to be following:However, Axe thinks the background color is
#ffffff
:Additional context
Tested with Firefox on Mac.
The text was updated successfully, but these errors were encountered: