Skip to content
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

Display notification when related background and foreground colours fail accessible colour contrast ratios #105

Open
thatisrich opened this issue Sep 19, 2024 · 0 comments · Fixed by #108
Assignees
Labels
enhancement New feature or request

Comments

@thatisrich
Copy link
Contributor

What problem does this address?

It is currently possible to assign elements colours that would fail accessibility colour contrast ratios when used within the theme. For example, it is possible to assign the same colour to both the background and text colour for a button hover, which would result in the text being completely unreadable.

Screenshot 2024-09-19 at 09 49 10

Including a notification alongside block / element instances where a background and foreground colour are present, and the colour contrast on the selected colours is below colour contrast ratios, would alert the user to this issue and allow them to make changes where possible.

A potentially helpful web based resource to check colour contrast ratios can be found at colourcontrast.cc.

What is your proposed solution?

One approach to this would be to use the WordPress ContrastChecker block, which accepts font size, background colour, and text colour as props and will be displayed if the contrast between the two colours does not meet the correct standard. Further information on this block can be found within the WordPress gutenberg repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant