-
bennyuk2
Hi,
Is it possible to setup a default button CSS style for a site.
Currently I have to use global styles, unassign the default and then apply a new style.I wondered if there is a way to define default CSS so that if a button is created and no styles applied it has a default style (colours, padding, margin, border radius, hover, etc).
Thanks
Ben -
Hi there,
it is possible to use some PHP to set the default button styles, see here for an example:
https://docs.generateblocks.com/article/sync-gb-button-style-with-generatepress-theme/
However, my personal preference would be to set up the Global Style on a button and then save that as a Pattern.
Then just add the Pattern whenever you need the button style.
This method allows you to update the global style in the future and apply site wide changes in one place. -
bennyuk2
Would it work if I set a fixed style to button.gb-button and button.gb-button.is-checked in “additional CSS”?
-
Yes, it will.
- You must be logged in to reply to this topic.