Skip to content

Axe fails with new color spec #4007

@enyo

Description

@enyo

Product

axe-core

Product Version

No response

Latest Version

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

Issue Description

Expectation

I’m using oklch on my page. I have added a media query to test if the browser supports it, and fall back to rgb() if not. I expect axe-core to either ignore my oklch definitions, or be able to parse them properly.

Actual

axe-core fails with:

axe-core Error: Unable to parse color "oklch(0.992 0.03 171.25)”

image

How to Reproduce

<div>Test</div>
<style>
  div {
    background: #000;
    text: white;
  }
  @supports (color: oklch(0% 0 0)) {
    div {
      background: oklch(0% 0 0);
    }
  }
</style>

Additional context

This prevents me from using the new color syntax since my accessibility tests completely break.

Metadata

Metadata

Assignees

Labels

color contrastColor contrast issuescommonsIssues in the common code (lib/commons)fixBug fixesprA pr has been created for the issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions