-
krempel-und-co
Hello!
I have an issue with the new global styles when it comes to buttons:
I have the global style class .cstm-button which sets font, background-color, hover effects, text color, padding. So far so good.
When I add a new button the button has the default blue style which doesn’t get overwritten when I add the custom style class .cstm-button as it’s background-color etc. is overwritten by the settings in the “Color”-Section of GB.
I know it’s intended that I can customize the look and feel via css on a element level which overwrites global settings. But with the legacy global styles I could set the button as “primary” or “custom” and the default settings were overwritten.
Am I missing something? Is there a better way to style default buttons in GP/GB and global styles are for those cases where you want to change the default look?
Thanks!
-
David
Hi there,
currently you can either Clear the local block styles after adding the global style.
By removing theblock
global style tag:https://docs.generateblocks.com/article/editing-a-global-style/#block
Or my preferred workflow is:
1. style the button as you require in the local styles.
2. create a new Global Style and MOVE the local block styles.
3. now create a Pattern of your Button.Now when adding buttons to your page, use the Pattern.
As the new patterns are same CPT as the core patterns you can even use the / shortcut to find them in the block appender. -
mikedo
This process should be easier. Creating a pattern for a button is a workaround not a solution. We should be able to style the appearance of the default button within the editor.
-
David
We have some plans for setting “theme” level styles which is where a default style can be set for a button.
But for now the Pattern method is the best way to go.
- You must be logged in to reply to this topic.