-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Block Editor: Fix color contrast checker #67036
base: trunk
Are you sure you want to change the base?
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +142 B (+0.01%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
Flaky tests detected in f13b8dd. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12502161305
|
58daf01
to
e5cc26e
Compare
Thanks for working on this, @juanfra! I pushed some minor changes, such as fixing the ESLint error and stylistic updates. The
|
f13b8dd
to
d3ed087
Compare
Thanks for the review and for pushing those changes, @Mamaduka! I appreciate it. I’m slowly easing back into things after the holiday break. I’ll take another look at this next week. I'm still hesitant this is the right approach, because originally the useEffect should be taking care of things, with the right dependencies. However, the values retrieved there are holding onto the previous state, so something isn’t quite right. |
What?
Fixes #67035
Adding an observer to the contrast checker with the objective of checking the styles changes in real-time, so that we show the correct messaging.
Why?
Right now, the contrast checker only runs when you change the block focus. This means if you’re adjusting colors for a block, the contrast issue message only appears after you switch to another element and then come back to the block controls. As a result, many users might miss the contrast warning entirely, defeating its purpose.
How?
Adding the observer, so the check runs when there are style changes for the block.
Testing Instructions
Screenshots or screencast
Screen.Recording.2024-11-15.at.15.28.02.mov