-
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
Overlay color controls not toggleable in 6.1+ #50046
Comments
I can confirm the issue. Currently, there's no check if returned values from @aaronrobertshaw, I remember you worked on recent refactoring/unification of color panels. What do you think about returning the additional |
Thanks for the ping 👍 I don't think we can apply a blanket rule to disable the Color panel if color supports have been disabled. As the panel is rendered via a SlotFill, it could be possible for a theme or plugin to disable the color supports but render their own custom controls into the Color panel. The catch here with the Cover block is that the overlay and opacity controls are ad hoc controls added to the Color panel slot by Cover block. I've put together #50115 which will only render the overlay and opacity controls if there are colors. Another contrived example to illustrate color related controls perhaps being desirable even without color support being enabled might be as follows:
Screen.Recording.2023-04-27.at.2.55.23.pm.mp4 |
Thanks for looking into this, @aaronrobertshaw. I wasn't suggesting a blanket solution; I understand that each block's implementation is different. My suggestion/plan:
We don't have to update all blocks in a single PR, but having a unified way of handling checks would be nice. Edit: I'll happily handle updates if this method looks good to you. |
Thanks for the clarification, I misunderstood. I can update the hook to return the additional flag. I also still need to update #50115 to fix the failing tests for the Cover block. |
Description
In previous versions of WP the core color settings are disabled entirely based on the settings object being passed an empty color or gradient array. However, in versions 6.1+ , the color controls panel will still show (even with color controls disabled) for the overlay color. This same panel will not show if color settings are disabled for both background or text colors.
In the case where an empty palette is passed to the settings object, the panel is visible and an empty palette is present as shown in the below photo
Step-by-step reproduction instructions
Set the following settings in the editor:
add core/cover block. notice that the color settings panel is still visible in the side bar, however the palette container shows an empty div.
Screenshots, screen recording, code snippet
No response
Environment info
No response
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: