How to Move Block-Level Styles to Classes in GenerateBlocks

As you start using the new class system in GenerateBlocks, you might encounter sections you created before the system existed or find yourself accidentally styling elements at the block level instead of …

Published:

Filed Under:

General

Kyle Van Deusen

The Admin Bar

After spending 15 years as a graphic designer and earning a business degree, I launched my agency, OGAL Web Design, in 2017. A year later, after finding the amazing community around WordPress, I co-found The Admin Bar, which has grown to become the #1 community for WordPress professionals. I'm a husband and proud father of three, and a resident of the Commonwealth of Virginia.

Fixed

This content contains affiliate links. View our affiliate disclaimer.

As you start using the new class system in GenerateBlocks, you might encounter sections you created before the system existed or find yourself accidentally styling elements at the block level instead of using classes. Thankfully, GenerateBlocks has a built-in system that makes it easy to transfer block-level styles into classes, allowing you to reuse those styles across your entire website.

In this post, I’ll walk you through how to move block-level styles into classes step by step.

Youtube video

The Problem with Block-Level Styles

When you style elements at the block level, those styles are tied to that specific block. This makes it difficult to reuse the same styles elsewhere on your site. By moving these styles into a class, you can apply them to multiple elements and make global updates with ease.

Demo Setup

For this demo, I’ve set up a container with an inner container.

Block-Level Styles Applied

  • Inner Container:
    • Background color.
    • Border radius.
    • Padding.
  • Headline: Styled individually at the block level.
  • Button: Styled individually at the block level.

The goal is to move these block-level styles into classes so they can be reused across the site.

Moving Styles to a Class

Step 1: Create a Class for the Container

  1. Select the container.
  2. Scroll to the top of the settings panel and add a class name (e.g., CTA-wrapper).
  3. Click Create.

When you create a class, you’ll see four options:

  • Empty Style: Start with a blank class.
  • Clone Existing Style: Copy styles from another class.
  • Copy Block Styles: Copy styles from the block to the class (styles remain on both).
  • Move Block Styles: Move styles from the block to the class (styles are removed from the block).

Since we want to transfer the styles entirely to the class, select Move Block Styles and click Start Editing.

Step 2: Verify the Styles in the Class

Once the styles are moved, you’ll be editing the CTA-wrapper class.

  • Backgrounds: The background color is now part of the class.
  • Spacing: Padding values have been transferred.
  • Borders: The border radius is included.

If you check the block-level settings, you’ll see indicators showing that these properties are now controlled by the global style. The original values are no longer at the block level.

Repeating the Process for Other Elements

Headline

  1. Select the headline.
  2. Add a class name (e.g., CTA-heading) and click Create.
  3. Choose Move Block Styles to transfer the styles to the class.

Button

  1. Select the button.
  2. Add a class name (e.g., CTA-button) and click Create.
  3. Choose Move Block Styles to transfer the styles to the class.

The button’s styles, including padding, background colors, and hover states, are now part of the CTA-button class.

Why This System Is Useful

This system is incredibly intuitive and solves a common problem: updating older designs or fixing elements styled at the block level.

By moving styles into classes, you can:

  • Reuse styles across your site.
  • Make global updates quickly.
  • Maintain a more organized and scalable design system.

Final Thoughts

Whether you’re updating sections created before the class system or correcting block-level styling habits, GenerateBlocks makes it easy to switch everything over to a class-based system.

This feature is a game-changer for improving your workflow and ensuring consistency across your site. If you haven’t started using classes in GenerateBlocks yet, now is the perfect time to dive in and take advantage of this powerful system.

Kyle Van Deusen

The Admin Bar

After spending 15 years as a graphic designer and earning a business degree, I launched my agency, OGAL Web Design, in 2017. A year later, after finding the amazing community around WordPress, I co-found The Admin Bar, which has grown to become the #1 community for WordPress professionals. I'm a husband and proud father of three, and a resident of the Commonwealth of Virginia.

Come Join Us!

Join the #1 WordPress Community and dive into conversations covering every aspect of running an agency!

Kyle Van Deusen

Community Manager

Latest Events

February, 26th, 2026

Code Snippets Are Slowing Down Your Website

Why Perfmatters Built a Performance-First Snippet Manager

September 16, 2025

Termageddon 2.0

Better Tools, Smoother Workflows, Happier Clients
Tpdc onblue

Learn a proven discovery framework to transform casual leads into high-paying clients.

View the Course
The Friday Chaser

Wash down the week with the best of The Admin Bar! News, tips, and the best conversations delivered straight to your inbox every Friday!

More Articles

Customer support help desk icon with a question mark on a yellow background.

The Best Help Desk Tools for Web Agencies

WordPress agency owners share the support tools they actually use — and why getting requests out of your inbox is the move that changes everything.

A smiling man with glasses and a gray hoodie outdoors.

Member Spotlight: Markus Chvojka

Markus Chvojka has one of those backgrounds that makes a lot of sense once you hear …

A smiling man with glasses and a patterned shirt, member profile on The Admin Bar website.

Member Spotlight: Mayank Majeji

Mayank Majeji’s story feels a lot like the way many of us got into this industry: …