-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Color Panel appears on group block even if disabled in theme.json #41293
Comments
@johnstonphilip Thanks for filing an issue. While reviewing your ticket, I learned that in order to disable the color panel for a given block, you need to disable color-related properties in the I.e. setting {
"version": 2,
"settings": {
"appearanceTools": true,
"blocks": {
"core/paragraph": {
"color": {
"link": false
}
}
}
}
} |
Interesting. Despite that this is a bug though right? It should never be in this state where it shows but there's no controls within it, unless I'm missing something! |
By the way, it’s the same if you don’t use a |
@johnstonphilip I experimented with the
Having said that, I've come across a very similar bug (I assume it's a bug). The
Even with the above, I have to add the same |
This seems to be because there is a check beforehand if gutenberg/packages/block-editor/src/hooks/border.js Lines 319 to 323 in 046ca65
However, you can disable it specifically for the button block: https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/#settings-examples |
Thank you @MatzeKitt for the context and look through the code 😄 ... my point was this behavior is unexpected to me. I expect no block to show Radius in a Border panel when that is specifically set to |
I’m absolutely on the same side but just wanted to point out a solution, since I needed it. 😄 |
I was able to trace this down to 2 places. The first place is here:
Really, if there's nothing to show, that should I wasn't able to track down whether the value of But while fixing that would at least make the I was able to track that down to here:
This would be the more ideal place to do a Unfortunately I ran out of time to pursue this further today. |
Looking into this behaviour a bit, it seems that both on a global and a block level, it's possible to disable
(Also, setting For the color panel to not render for a specific block type, it's enough to disable all the color settings for that block, e.g., for Gallery, that has only background, the above code snippet is enough to make the panel go away. In my testing, the following global setting was enough to hide the color controls altogether for all blocks:
While this works, it's not at all intuitive and could use some improvement. It should be possible to remove the "background" control by just setting |
Source: WordPress/gutenberg#41293 (comment) Needed to set `gradient: []` in theme.json to prevent that box from showing up if other bg colors not supported.
I am not able to reproduce this issue anymore in 6.4.3 and 6.5 RC.
|
Can confirm that the settings are now being respected correctly. |
Description
If I disable everything relating to colors in theme.json, the panel still shows up on blocks that support it, such the
group
block.Step-by-step reproduction instructions
Color
panel in the sidebar, even though you can't do anything with it. Interestingly it shows a "background" option that opens apopover
with nothing inside it.Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: