Skip to content
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

False positive: 'color-contrast' rule fails on intentionally invisible text #2171

Closed
kylemh opened this issue Apr 21, 2020 · 2 comments
Closed

Comments

@kylemh
Copy link

kylemh commented Apr 21, 2020

Expectation: CSS-Hidden Screen Reader Only text or text with opacity intentionally set to zero with the express purpose of becoming visible on animation later should not trigger color contrast ratio violations.

Actual: Both above cases cause rule breaks

Motivation: Screen Reader Only text is my biggest motivation. Having been at multiple places where design gets final word on things, I want to provide queues and content to people hard-of-sight or devoid-of-sight. At these same places, I may be also dinged via automated tooling whose quota I may be mandated to meet.

axe-core version: 3.5.1

Lighthouse uses 3.5.1, that is.


After template

I saw this issue: #1456

Which seems like my React component's styling should behave the same (since width and height are at 1px)... but you will see many accessibility violations on this page: https://www.operationcode.org/code_schools

@straker
Copy link
Contributor

straker commented Apr 27, 2020

The color contrast rule should filter out nodes that are hidden by CSS. However, looking at the page I see each card has multiple very light grey text nodes (which are usually proceeded by screen reader only text). These are the majority of failures from what I randomly selected, and they are correct failures as the text fails contrast.

image

@kylemh
Copy link
Author

kylemh commented Apr 27, 2020

Awkward. I presumed it was referencing a different node. Sorry that I had you do an audit for me. I'll fix that problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants