Skip to content

Bug testing color-contrast when forced-colors active in v4.6 #3978

Open
@nolandanley

Description

@nolandanley

Product

axe-core

Product Version

v4.6

Latest Version

  • I have tested the issue with the latest version of the product

Issue Description

Expectation

When running color-contrast checks with forced-colors active, the colors used in the contrast calculation should be the colors presented with forced-colors.

Actual

The foreground color is calculated from the non-forced color and the background is calculated from the forced color.

How to Reproduce

I don't think one will be needed, but I can try to come up with one if needed.

Additional context

In this commit, get-foreground-color was changed to use -webkit-text-fill-color rather than color. This property is unchanged when forced-colors is active. The background, however, is still using the background-color property which does change when forced-colors is active.

This introduced a regression to my company's use of axe-core running color-contrast when forced-colors is active since it now uses a mix-and-match of forced and non-forced color values. I think it's probably unintended to mix-and-match, but I'm curious if axe-core even intends to support running color-contrast with forced-colors active.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions