-
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
custom Cover Block overlay color overwritten by "has-background-dim" #25290
Comments
Actually the order of the CSS is correct, the issue here is the specificity for the However, the I guess the solution would be to add a space between the
I think this is somehow related to #11779. |
Hey @luminuu, you're right. I totally overlooked that. The custom color would have priority ofer the "has-background-dim" class if it wasn't "tied" to the "wp-block-cover" class. Adding a space would solve this. |
Hi there! did you try using the Gutenberg plugin? I think we fixed this recently and it's something that might come in the next WP major release. |
I have activated the Gutenberg plugin on my development site where I have this issue and it did not fix it. Still having the black color instead of the selected background color on the frontend. |
So I set up a development environment with Gutenberg and changed the mentioned CSS to have a space. Sadly this breaks the default functionality alltogether, so it does not seem to be an option. Checking how other themes handle this, I assume it's easier to adjust the theme's CSS to either one of these options:
or
But then the documentation on color palettes needs to be updated. |
Hi, I experience the same issue. I don't think rising specificity of theme color classes is the way here. There are other issues with colors in Gutenberg since WordPress 5.5 update and I don't get any luck having them resolved in the plugin while they still cause issues on websites. I went ahead and adapted the specificity of theme color classes as a temporary fix, but that's really not ideal way as I either need to use Could anyone from plugin developers please provide feedback on these issues? Thanks for any info provided! Regards, Oliver |
Describe the bug
When adding a cover block and picking a color registered by a theme/plugin, the "has-background-dim" class overrides the custom class styles that's added by the theme/plugin.
Here's the CSS classes constructed for the cover block:
class="wp-block-cover has-wpbf-palette-color-2-background-color has-background-dim"
The problem is that the "has-background-dim" class is added AFTER the "has-wpbf-palette-color..." class which makes it override the color.
Because the color tweak is the "more granular" change, the "has-wpbf-palette-color..." class should be added at the end, after the has-background-dim class.
To reproduce
Steps to reproduce the behavior:
Expected behavior
The "has-wpbf-palette-color..." class should be added after "has-background-dim".
Editor version (please complete the following information):
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: