Archived topic
Button colours and font
13 replies · Started by Helen on January 18, 2023
Hi
I have set my global colours via the Generate Press options in the Customiser. However, the button colour I have set does not show. The buttons I insert are showing the Default Generate Press colour. What have I done wrong?
The font I have linked to locally, is also not rendering in the Gutenburg editor, although it is displaying fine when previewed. Is there anything I can do about this?
Thanks,
Helen
Hi Helen,
I believe the Buttons you which to alter the colors of are GenerateBlocks buttons. To alter these, you'll need to alter them from the Block settings. Reference: https://docs.generateblocks.com/article/buttons-overview/#colors
Shouldn’t I be able to set the colours of button globally in the customiser?
The one in the customizer works for WordPress-generated Buttons like the default "Read more" button.
For GB Buttons, if you want global control over them, you'll need GB Pro. You can then use Global Styles. Reference: https://docs.generateblocks.com/article/global-styles/#:~:text=Adding%20a%20Global%20Style,for%20this%20block%20by%20default.
Thanks, I do have GB Pro, so I will look at your reference doc.
My second question was about font rendering. Do you have any idea why my font fails to render in the Wordpress editor? I have installed Proxima Nova locally which is working on the front end, but is rendering as Times in the Editor making it difficult for me to see the typography design.
Thanks,
Helen
Hi there,
you need to tell WP to load local fonts in the editor.
You can use this PHP Snippet to load your Customizer > CSS in the editor:
add_filter( 'block_editor_settings_all', function( $editor_settings ) {
$css = wp_get_custom_css_post()->post_content;
$editor_settings['styles'][] = array( 'css' => $css );
return $editor_settings;
} );
How to Add PHP:
https://docs.generatepress.com/article/adding-php/
Fantastic, that works a treat.
Thank you both for your help.
Glad to hear that !
Hi there,
I came across this thread because i was also wondering why the button formatting was not working. I'm using the free version of GB.
I tried to create a global style for the GB buttons via CSS. But this works only conditionally. Strange thing is: all styles are taken over, just not the background color (accent-2 is a dark green):
https://prnt.sc/sB2QsmN7KtfF
mhmm...🤔
Hi there,
try improving the specificity of the CSS selector eg.
a.gb-button {
/* your styles */
}
Hi,
thanks for the quick reply!
But this selector causes none of the formatting to work anymore:
https://prnt.sc/gjqrHXvC77LD
Can you raise a new topic - where you can share a link to your site and i can take a look ?
Hi David,
thank you for your support!
I have found out now. This selector works:
.gb-button-wrapper a.gb-button
CSS is really weird sometimes 🙄
Glad to hear that :)