dequelabs / dequelabs/axe-core

Use of `content-visibility` CSS rules can lead to false colour contrast issues being reported

Open
#2,768 2 comments 1 reaction 0 assignees View on GitHub
ACT Rules color contrast fix
Dominant language
JavaScript
Stars
7.5k
Forks
933
Avg merge
2d 13h
Merged PRs (30d)
29

Description

Expectation: All content on the page should have its colour contrast evaluated correctly

Actual: Content that is not yet rendered (because of `content-visibility` rules in CSS) can result in false colour contrast issues being reported

Motivation: I'd like to avoid the false positives and get back to my 100 score on Lighthouse :)

---

I'm not sure if a bug exists for this already (I searched for `content-visibility` but couldn't find anything), but there has been some discussion of it last year on Twitter, including a comment from @straker (apologies if this issue is already being tracked elsewhere):

* https://twitter.com/slightlylate/status/1338281294694735872
* https://twitter.com/sundress/status/1338294674516107265
* https://twitter.com/StevenKLambert/status/1338632222178332676

You can see an example on https://infrequently.org as mentioned by @slightlylate on Twitter - colour contrast issues are reported with some of the `` elements, but these have a sufficient ratio.

Chrome 88.0.4324.96

Lighthouse 6.4.0

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported contrast issues on infrequently.org using the stated Chrome 88 and Lighthouse 6.4.0 versions, then trace how content-visibility affects contrast evaluation. Done means content hidden by content-visibility no longer produces false colour-contrast violations while visible content is still evaluated.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
Domain
accessibility
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.