- This topic has 7 replies, 2 voices, and was last updated 6 months, 2 weeks ago by Tom.
August 23, 2020 at 11:40 am #1415175Whelan
I’m using standard Gutenberg buttons with outline style and NO background. I set the colour in the editor but it’s being overridden by wp-includes/css/dist/block-library/styles.css.
I think it’s happening because I have not specified a background colour…. I don’t want a background colour and, for this site, I don’t need to use GP Blocks.
This is relevant to GP because I think the problem started when I specified the button and link colours using the GP Premium Colour Module. It’s odd that even though there’s inline css and colour module generated css… both are overridden. I read somewhere it’s got something to do with this Gutenberg rule:
Any explanation or advice would be most appreciated.
As a workaround, I can override it using the additional css, but I want a WYSIWYG experience for the end user. For now I’ve commented out my workarounds so that you can have a look.August 23, 2020 at 1:11 pm #1415235TomLead DeveloperLead Developer
It looks like Gutenberg is enqueuing their style.css file later than the GP CSS.
They’re setting a text color and a transparent background color, which is strange. Is there a reason you want to use their built-in buttons vs another solution? You could even consider using a regular core button but giving it a class to make it outline.August 24, 2020 at 2:07 am #1415637Whelan
Hi Tom, yes that seems the problem – I’m not sure what I’ve done to mess with the cascading order. At the moment, the GP settings are: css is not combined (yet). Dynamic css is generated externally.
In troubleshooting mode I have this error: “Uncaught Error: Call to undefined function wp_is_auto_update_enabled_for_type() … htdocs/wp-admin/includes/theme.php:752”
The error does not appear to be related to GP, but I don’t know if it could cause the css files to load in the wrong order. If you think it is related, please let me know and ignore the rest of this message.
My broad aim is to ensure I set up GP Premium to work well with core Gutenberg on all my sites – only using alternative button plugins etc. when absolutely necessary.
On this particular site my client needs Jetpack forms and Woocommerce, so I want matching buttons that the client can insert as needed… core editor buttons are also an Automattic “product” so that’s my preference.
Ideally, I want subtle outline buttons which default to using the same colour and border as the text (“border: currentcolor”) and have no background colour, so they blend in, irrespective of the page background.August 24, 2020 at 10:09 am #1416459TomLead DeveloperLead Developer
From what I can see, the GP stylesheets are indeed loading after the core Gutenberg stylesheet.
So just to confirm, you want:
1. The outline style to have no background color (obviously).
2. The outline style to still use your GP button text color for the text and border?August 24, 2020 at 2:25 pm #1416742Whelan
Yes, that’s the style I want… and it’s how I’d like it to appear in the editor by default.
Here’s a screenshot of all the relevant settings and how it currently appears – https://drive.google.com/file/d/1-ZSydcG3DoVRIe3etHCfhYsQYCbcrhp3/view?usp=sharing
NOTE * I’ve just realised that the Central Color Palette plugin seems to be part of the problem.
I’ve disabled it and – alternatively – manually set the palette as described here: https://generatepress.com/forums/topic/customizing-generateblocks-color-palette/
…but I still would like the core button to use GP text color settings without having to write extra css. (see my screenshot).August 24, 2020 at 3:11 pm #1416759TomLead DeveloperLead Developer
Ok, so right now I’m seeing:
1. The button getting the background color and text color from the Button Customizer options.
is-style-outlineclass Gutenberg adds removing the background color, and setting a 2px border.
3. A border-radius and a custom text color being added inline for the button.
What you’d like:
3. Use the content link color set in the Customizer instead of having to set the color inline.
Is that correct? Just trying to get a feel for this to see if we can add it into GP 3.0 🙂August 24, 2020 at 3:13 pm #1416760Whelan
Yes, that is correctAugust 24, 2020 at 3:14 pm #1416762
- You must be logged in to reply to this topic.