Site logo

Archived topic

GenerateBlocks Button block default GP styling

22 replies · Started by Natalie on March 25, 2020

Viewing posts 1–15 of 23

Thanks so much for GenerateBlocks!!!

This post is mainly to help others but also to check I have done the right thing.

I have created a button block.

I wanted the buttons to get the default styling I have already set up in appearance / customize /colors /buttons and
appearance / customize /typography / buttons (plus any default button styling from the GP theme)

So for each button, in the block editor under 'advanced' I added 'button' as a CSS class

Then in the 'colors' section I clicked on the 'background color', then clicked the 'clear color' button. You need to do this for the 'Normal' state and the 'Hover' state. (You may need to do this for text color as well, but my text color was the same so I left it)

Then in the 'spacing' section, clear the values for 'padding'

Is there an actual 'clear defaults' option that would do all that automatically?

Hi there,

Glad you're enjoying it!

Setting defaults is possible via a filter right now, but I wouldn't suggest using it until we're out of alpha, as filter names/structure may change between now and then.

any tutorial how to change default button look in generateblocks?

Hi Tom,

any tutorial how to change default button look in generateblocks?

If it isn't styled within the Gutenberg editor, GB buttons follow what the theme assigns as the button color.

That said, assuming you're using GP premium, this default button color setting is found on Dashboard > Appearance > Customize > Colors > Buttons.

I'm actually talking about generateblocks... and customize doesn't have rounded border etc... it's completely different...

What I need is to set default button look in generateblocks (typography, borders, colours, spacing)

Hi Tom,

I also wish to be able to set a default global button style for the GenerateBlocks buttons...because I really don't want to have to change every single button and hover state individually. All the buttons on the website will look the same, so I just want to add it once via css etc.

So, first I tried setting up my own css class to add. But even that wouldn't override the color, background-color, and padding options.

So, then I removed my custom css and added the filter you linked to (in my child theme functions file.) But it doesn't seem to be working. The colors still don't change.

I would just love to have a global button style I can apply for background-color, color, and padding (I wish there was a way to clear the defaults...so I could just add it myself in my css stylesheet or the customizer. Seems strange the GenerateBlocks Button block doesn't inherit the Button styling from the theme.)

Any help would be greatly appreciated (if you have a new filter for example or a css class I can target.)

Thanks in advance!
R

Hi Ying,

Thank you for the fast reply...but I'm not using GenerateBlocks Pro. I'm looking for a solution without that.

I usually do all my styling etc. through a child theme css file. But I've been trying out the GB and liked the ease of using it for certain things. But the button thing is not making things easier.

I'm just wondering why the default styling for the GB buttons wasn't applied to the gb-button class? That way anyone could simply change that class in their css. And, in theory, if other people used the customizer within GB it would apply to the more specific individual button class and override gb-button...no?

Having a global button style is super important for a lot of reasons. Just looking for a solution for that with GB buttons.

So, is this a question I should add to the other forum? I used this thread as it related exactly to my issue. And the fix in this thread did not work for me.

Thank you!

R.

Yes, it's better post this question in GB's support community, when this thread was started there was no GB support forum yet.

I believe this thread should be helpful for other GB users as well, since a lot of them are not using GP as theme.

Thanks for your understanding!

Okay, no worries. I'll start a thread over there.

Thank you! :)

P.S. And thank you for the links. I didn't know those forums existed. Haha. And looks like my question may have been answered last month. Going to try it out now.

Cheers! Have an awesome day!

Thanks Rachelle, same to yourself too :)

Hi Elvin

That said, assuming you’re using GP premium, this default button color setting is found on Dashboard > Appearance > Customize > Colors > Buttons.

I am using GP Pro & GB Pro and GB buttons seem to simply ignore what is set in customizer button colors. The only way I can override them is by inserting 'additional css' on 'gb-button', or use standard button instead!

Matt

This archived topic is closed to new replies.