Product
axe-core
Product Version
4.12.1
Latest Version
Issue Description
When a computed color serializes with a CSS Color 4 none component (for example oklch(0.7 0.15 180 / none) or lab(40 none 20)), the color parser fails and the color-contrast check is silently skipped for those nodes. They appear in neither violations nor incomplete.
Expected: color-contrast evaluates these elements, or at minimum reports them as incomplete.
Actual: no result at all for color-contrast on the affected nodes, which is indistinguishable from a page that genuinely passes.
Steps to reproduce:
- Create a page with low-contrast text whose color is set via
oklch() with one component written as none. Modern browsers serialize interpolation results this way, and recent Tailwind CSS versions emit it for achromatic colors.
- Run axe with the
wcag2aa tag set.
- Observe the element is absent from both
violations and incomplete for color-contrast.
- Change the
none component to 0 and run again: the violation now appears, so the page itself is unchanged and the difference is in the parser.
Impact: silent false negatives on WCAG 1.4.3. Because the rule produces no result rather than an error, automated audits report no contrast findings on affected pages. This affects a growing share of production sites built with frameworks that emit oklch by default. A fallback to incomplete would preserve honesty even where parsing is not implemented.
Workaround we apply: normalizing none components to 0 in computed styles before invoking axe, which restores measurement.
I can provide a minimal HTML reproduction if that is useful.
Product
axe-core
Product Version
4.12.1
Latest Version
Issue Description
When a computed color serializes with a CSS Color 4
nonecomponent (for exampleoklch(0.7 0.15 180 / none)orlab(40 none 20)), the color parser fails and the color-contrast check is silently skipped for those nodes. They appear in neitherviolationsnorincomplete.Expected: color-contrast evaluates these elements, or at minimum reports them as
incomplete.Actual: no result at all for color-contrast on the affected nodes, which is indistinguishable from a page that genuinely passes.
Steps to reproduce:
oklch()with one component written asnone. Modern browsers serialize interpolation results this way, and recent Tailwind CSS versions emit it for achromatic colors.wcag2aatag set.violationsandincompletefor color-contrast.nonecomponent to0and run again: the violation now appears, so the page itself is unchanged and the difference is in the parser.Impact: silent false negatives on WCAG 1.4.3. Because the rule produces no result rather than an error, automated audits report no contrast findings on affected pages. This affects a growing share of production sites built with frameworks that emit oklch by default. A fallback to
incompletewould preserve honesty even where parsing is not implemented.Workaround we apply: normalizing
nonecomponents to0in computed styles before invoking axe, which restores measurement.I can provide a minimal HTML reproduction if that is useful.