Allow checking contrast at AAA level with contrast-checker #31223
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Status] In Progress
Tracking issues with work in progress
[Type] Enhancement
A suggestion for improvement.
What problem does this address?
The current contrast-checker component in core uses the tinycolor library to check the contrast between two colour values. The specific
isReadable
method used by contrast-checker supports both level AA and AAA, but currently level AA is hard-coded into the WP component:This means that for site owners or developers wishing to enforce criterion 1.4.6 Contrast (enhanced), doing so would require developing a custom component.
What is your proposed solution?
Level AA is a very good default and I do not propose changing this. However, adding a JS or PHP filter for the level would at least allow developers to change the level relatively easily.
The text was updated successfully, but these errors were encountered: