under construction WordPress Buttons are one of the most common interaction elements when it comes to websites. To improve design consistency and maintenance efficiency, the use of GenerateBlocks pro's Global Styles(The (Global Styles) feature helps you create a set of reusable, centrally manageable button styles.
This article will take you step by step through the process of creating, optimizing and reusing button styles.
![Image [1]-GenerateBlocks Pro Global Button Styling Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520093340879-image.png)
Why use Global Styles?
While traditional button styling needs to be manually adjusted on each page or module, GenerateBlocks Pro provides a global styling system that lets you set it once and reuse it in multiple places. Whether you need to create primary buttons, secondary buttons, or link buttons, all can be centrally managed and quickly maintained.
Second, create the first button style (Primary)
Step 1: Add the button element
- Edit any page or article
- Add button blocks for GenerateBlocks (click on the button element with the blue icon)
- Set the button's
display
attributeinline-flex
To avoid misdisplay in the editor
![Image [2]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520094058830-image.png)
Step 2: Create Global Style
- Click "Create Style", it is recommended to use prefixed class name, such as
btn-primary
The following are some of the most popular plug-ins in the world, reducing the probability of conflicts with other plug-ins
![Image [3]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520094152292-image.png)
- Select "Start with blank"
![Image [4]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520094233220-image.png)
Step 3: Setting Style Properties
- Background color: choose a dark brand color from the theme
![Image [5]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520094347792-image.png)
- Border: 1px width, color matches the background
![Image [6]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520094528912-image.png)
- Rounded corners: 100px, giving the appearance of rounded pill buttons
![Image [7]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520094616601-image.png)
- Inner margins: top and bottom 1rem, left and right 2rem
- Text Style:
- Color: white
- Size: 1.125rem
- Word weight: 500
- Uppercase (Text Transform: Uppercase)
![Image [8]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520094744474-image.png)
Step 4: Setting up the hover effect
- Click on the "Hover" tab to enter the hover state settings.
- Background color: change to a lighter shade of the same color
![Image [9]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520094846618-image.png)
- Border color: synchronously updated to light color to avoid visual conflict
![Image [10]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520095345219-image.png)
- Adding a shadow: generated using the box-shadow generator CSS Shadow code and paste
![Image [11]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520095135160-image.png)
- Add transition animation: set a 0.2 second transition effect for the button to make hovering more natural.
![Image [12]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520095225879-image.png)
Creating a reusable Box Shadow utility class
For ease of invocation, shadows can be set as a standalone style class
- New global style named
shadow-primary
![Image [13]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520095437675-image.png)
- Add Effect → Box Shadow → Paste Generator Code
![Image [14]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520095519539-image.png)
- Simply add the class name to the button to use the same shadow effect
IV. Examples of button style variants
1. Secondary button style (Secondary)
- Background set to transparent
![Image [15]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520100001530-image.png)
- Text color is the main brand color
![Image [16]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520100026186-image.png)
- Fill background color on hover, text becomes white
![Image [17]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520100128664-image.png)
- inheritable
btn-primary
The visual uniformity of the borders, rounded corners, inside margins, etc.
2. Link button style (Link)
- Border set to transparent
![Image [18]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520100401992-image.png)
- Show only border color on hover, no background change
![Image [19]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520100504440-image.png)
- Background color: change to transparent and border color to dark.
![Image [20]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520100631220-image.png)
- When hovering, the border effect is displayed
![Image [21]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520100931777-image.png)
- Effect when not hovering
![Image [22]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520101010592-image.png)
V. Style Priority and Order Description
exist GenerateBlocks → Global Styles:
- Ability to view specific properties and states (default, hover) for each style class
![Image [23]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520101233259-image.png)
- Similar to CSS, a class added later will override the style of the class before it.
![Image [24]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520101258306-image.png)
- You can adjust the order of the classes by dragging them to control the priority of the styles to take effect.
![Image [25]-GenerateBlocks Pro Global Button Styles Tutorial: Creating Reusable Button Designs](http://gqxi.cn/wp-content/uploads/2025/05/20250520101336940-image.png)
VI. Advantages of unified maintenance and management
Once the button classes have been created, these style classes can be used directly anywhere on the site. Modify them once and the buttons are synchronized across the site, helping to improve efficiency and consistency.
Example:
- modifications
btn-primary
or rounded corners, all buttons that reference it will automatically synchronize the adjustment of the - After updating the hover effect, you don't need to repeat the setting
concluding remarks
GenerateBlocks Pro's Global Style system is a useful tool for building modular button designs. Splitting and reusing properties such as the main button, shadow, border, color, etc. saves time and reduces repetitive actions.
If you're using GenerateBlocks to build the WordPress website, it is recommended that global button styling be part of the standard development process to help you quickly build uniformly styled website components.
Welcome to Photon Fluctuations for more WordPress efficient site building tutorials and design practice content.
Recent Updates
Link to this article:http://gqxi.cn/en/55269The article is copyrighted and must be reproduced with attribution.
No comments