-
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
Navigation: Add clearable option to color picker in navigation
block
#68454
Navigation: Add clearable option to color picker in navigation
block
#68454
Conversation
navigation
block
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Works as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if the failing tests are related, but it should resolve. Approving for code logic.
Hi @t-hamano, can you please review this PR when you get a moment? |
I think we should first consider whether we need a consistent clear button. Because there is precedent in the past where the need for this clear button has been debated and removed (#42689). @WordPress/gutenberg-design Is this clear button necessary in the current Gutenberg? By the way, currently there is a reset button that appears when you hover the mouse over an item if it has a color value. Whether this reset button is displayed or not is synchronized with the |
Thanks for the review @t-hamano.
This feature becomes quite helpful when clearing the colors. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that PRs similar to this one were merged recently:
- Social links block: Add Clear button for color option #68564
- Post Featured Image: Adds control to clear the the overlay color. #68525
Maybe it's better to have a consistent clear button now, so I'm accepting this PR. Sorry for the confusion 🙇♂️
However, if the button text is long, the reset button will cover the text:
We'll need to address this issue separately.
I've taken this case into account and am working on it. Thanks for the review! |
What, Why and How?
This PR introduces a
clearable
button, allowing users to easily clear applied colors. It ensures consistency between theColor Picker
in theSub Menu
and the one in theNavigation
block.The
clearable
option has been added to the settings for all applicable settings, effectively addressing the issue.Testing Instructions
Navigation block
to your page.Background Color
to the block.Clear button
to remove the applied color and verify that it works as expected.Screenshots
Screencast
Closes: #68453