- This topic has 12 replies, 6 voices, and was last updated 1 month ago by Ying.
March 25, 2020 at 6:07 am #1209430Natalie
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?March 25, 2020 at 4:19 pm #1210164TomLead DeveloperLead Developer
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.November 5, 2020 at 3:57 pm #1519805Tom
any tutorial how to change default button look in generateblocks?November 5, 2020 at 4:01 pm #1519808ElvinStaffCustomer Support
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.
A wise man once said:
"Have you cleared your cache?"November 5, 2020 at 4:31 pm #1519824Tom
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)November 6, 2020 at 9:11 am #1520801TomLead DeveloperLead Developer
You can filter the defaults like this: https://generatepress.com/forums/topic/add-custom-css-selector-to-the-button-selector/#post-1322768March 9, 2021 at 9:03 am #1688437Rachelle
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!
RMarch 9, 2021 at 10:01 am #1688518YingStaffCustomer Support
If you are using Generateblocks pro, there’s a function called Global style.
You could have a look at this demo video to have a better understanding.
https://www.youtube.com/watch?v=GjyYcr8ldHQ&ab_channel=GenerateBlocksMarch 9, 2021 at 10:15 am #1688532Rachelle
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.
R.March 9, 2021 at 11:14 am #1688599YingStaffCustomer Support
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!March 9, 2021 at 11:17 am #1688603Rachelle
Okay, no worries. I’ll start a thread over there.
Thank you! 🙂March 9, 2021 at 11:20 am #1688605Rachelle
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!March 9, 2021 at 11:49 am #1688636YingStaffCustomer Support
Thanks Rachelle, same to yourself too 🙂
- You must be logged in to reply to this topic.