add logic for custom color boolean for borders#72402
add logic for custom color boolean for borders#72402n8finch wants to merge 2 commits intoWordPress:trunkfrom
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @n8finch@git.wordpress.org, @snibe. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @n8finch! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
a0dc8ae to
4766831
Compare
First PR for Gutenberg, woohoo!
What?
Closes #59567
This PR fixes the
disableCustomColorsprop that was not being set in theBorderBoxControlelement.Why?
If the custom color setting is disabled in the
theme.jsontheBorderBoxControlelement was not picking up on that setting.The setting was respected when picking text and background colors though, as these use the
ColorPanelDropdownelement.How?
This PR adds a local method to the
BorderBoxControlelement and checks for the theme setting in a similar manner that other settings are being checked and set.I've tried to make it as close as possible to the implementation in the
ColorPanelDropdownelement, see related code:Testing Instructions
theme.jsonfile, and that you have thesettings.color.customproperty set tofalse(see screenshots)theme.jsonto betrueor remove it completely, reload the page, and repeat steps 3 to 6, at this point you should see the custom color picker.Testing Instructions for Keyboard
theme.jsonfile, and that you have thesettings.color.customproperty set tofalse(see screenshots)CMD + Shift + ,on a Mac orCtrl + Shift + ,on a PC.Border color and style pickertheme.jsonto betrueor remove it completely, reload the page, and repeat steps 3 to 6, at this point you should see the custom color picker.Screenshots or screencast
Also note that it respects setting to
trueand if it's removed