-
Notifications
You must be signed in to change notification settings - Fork 791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Axe fails parsing (OK)LAB & (OK)LCH colors containing 'none' keyword #4269
Comments
Thanks for the issue. Axe-core uses colorjs.io to parse color spaces. It looks like there are a few open issues about supporting |
@straker I've made a quick demo to play around with this where you can change the foreground & background color of a paragraph live: benjaminaster.com/bugs/axe-none-colors When audited in Chrome Lighthouse (which uses Axe under the hood), Lighthouse throws an error only when using (ok)lab/(ok)lch colors (e.g. On the other hand, Lighthouse recognizes I might be missing something here, but there seems to be a rather weird disconnect between which colors Axe in Chromium Lighthouse succeeds to parse vs. which colors Color.js can parse. |
That is indeed interesting. Our code mostly uses colorjs to parse the CSS string for the color bits but does have an exception only for HSL as colorjs doesn't support |
The CSS color functions
lab()
,oklab()
,lch()
andoklch()
can contain the specialnone
keyword as a "missing color component" which is treated special when interpolating colors, while simply treated as0
otherwise (see specification). Axe fails parsing such colors.The text was updated successfully, but these errors were encountered: