dequelabs / dequelabs/axe-core

Axe fails with new color spec

Open
#4,007 18 comments 2 reactions 1 assignee Claimed by @straker View on GitHub
color contrast commons fix pr
Dominant language
JavaScript
Stars
7.5k
Forks
933
Avg merge
2d 23h
Merged PRs (30d)
17

Description

### Product

axe-core

### Product Version

_No response_

### Latest Version

- [X] 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

```html

Test

div {
background: #000;
text: white;
}
@supports (color: oklch(0% 0 0)) {
div {
background: oklch(0% 0 0);
}
}

```

#### Additional context

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.