Skip to content

False Axe contrast failures due to CSS animations (color transitions) #1427

@gabalafou

Description

@gabalafou

Running the accessibility tests (nox -s a11y) produces some false contrast failures.

They are the result of running Axe (the automated accessibility checker script) on the page before certain color transitions have finished. This means that Axe measures the text color against the background while those colors are changing, before they have settled into their final state.

These failures all occur in dark mode because the color animation only happens when toggling the page from one theme to another, whether from light to dark, or dark to light. But I believe the page loads in light mode by default, which is why we don't see these false contrast failures in light mode: because in those cases, the test script toggles the page from light mode (default) to light mode, therefore there is no transition from one set of colors to another and therefore no animation of that transition.

The following PR fixes the issue for one page (Kitchen Sink Admonitions):

But we need to decide whether we want to get rid of these light-dark mode transitions, or wait for them to finish in the testing script.

The first task in this issue is therefore to:

  • Determine all of the remaining places that have a light-dark transition

Metadata

Metadata

Assignees

No one assigned

    Labels

    tag: accessibilityIssues related to accessibility issues or efforts

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions