[Skip to content](#main)

[→](/)

[![Avunu](/brand/avunu-logo.svg)![Avunu](/brand/avunu-logo-light.svg)](/)[Services](/services/)[Consulting](/services/consulting/)[ERP](/services/erp/)[Odoo](/services/erp/odoo/)[ERPNext](/services/erp/erpnext/)[Custom software](/services/custom-software/)[Devices & IoT](/services/devices-iot/)[Websites](/services/websites/)[Infrastructure](/services/infrastructure/)[Partners](/partners/)

[Work](/work/)[Open source](/open-source/)[Knowledge base](/kb/)[About](/about/)

[About Avunu](/about/)[Team](/about/team/)[Insights](/insights/)[Contact](/contact/)

[Client portal](https://erp.avunu.net/projects)[Start a project](/start/)

- [Services](/services/)[Consulting](/services/consulting/)
- [ERP](/services/erp/)
- [Odoo](/services/erp/odoo/)
- [ERPNext](/services/erp/erpnext/)
- [Custom software](/services/custom-software/)
- [Devices & IoT](/services/devices-iot/)
- [Websites](/services/websites/)
- [Infrastructure](/services/infrastructure/)
- [Partners](/partners/)

[Work](/work/)[Open source](/open-source/)[Knowledge base](/kb/)[About](/about/)

- [About Avunu](/about/)
- [Team](/about/team/)
- [Insights](/insights/)
- [Contact](/contact/)

[Client portal](https://erp.avunu.net/projects)[Start a project](/start/)

[Knowledge base](/kb/)[WordPress](/kb/wordpress/)Register custom block styles in a classic theme

Search the knowledge basePress/

ESC

Jump to

[Browse the knowledge base](/kb/)[Frappe](/kb/frappe/)[ERPNext](/kb/erpnext/)[Odoo](/kb/odoo/)[WordPress](/kb/wordpress/)[NixOS](/kb/nixos/)[Email](/kb/email/)[Linux](/kb/linux/)[Databases](/kb/databases/)[Containers](/kb/containers/)[Proxmox](/kb/proxmox/)[Git & Dev Tools](/kb/git-and-dev-tools/)

↵select↑↓navigateescclose

Search the knowledge base

[Skip to the article](#kb-article)[WordPress](/kb/wordpress/)10 articles

- [Overview](/kb/wordpress/)
- [Admin-only custom post types with custom list columns](/kb/wordpress/custom-post-type-admin/)
- [Docket Cache baseline configuration](/kb/wordpress/docket-cache-configuration/)
- [Gravity Forms](/kb/wordpress/gravity-forms/)
- [Populate Gravity Forms image choices from an ACF image field](/kb/wordpress/gravity-forms-image-choices-acf/)
- [Register custom block styles in a classic theme](/kb/wordpress/block-styles-classic-themes/)
- [Run WordPress cron from the system scheduler](/kb/wordpress/wordpress-cron/)
- [Split a child theme's functions.php into included files](/kb/wordpress/child-theme-file-includes/)
- [WordPress database optimization queries](/kb/wordpress/database-optimization-queries/)
- [WordPress debugging snippets](/kb/wordpress/debugging-snippets/)
- [WP-CLI cookbook](/kb/wordpress/wp-cli-cookbook/)
- [wp-config.php reference](/kb/wordpress/wp-config-reference/)

Other sections[Frappe](/kb/frappe/)[ERPNext](/kb/erpnext/)[Odoo](/kb/odoo/)[NixOS](/kb/nixos/)[Email](/kb/email/)[Linux](/kb/linux/)[Databases](/kb/databases/)[Containers](/kb/containers/)[Proxmox](/kb/proxmox/)[Git & Dev Tools](/kb/git-and-dev-tools/)

In WordPress: 10 articles

[Overview](/kb/wordpress/)[Admin-only custom post types with custom list columns](/kb/wordpress/custom-post-type-admin/)[Docket Cache baseline configuration](/kb/wordpress/docket-cache-configuration/)[Gravity Forms](/kb/wordpress/gravity-forms/)[Populate Gravity Forms image choices from an ACF image field](/kb/wordpress/gravity-forms-image-choices-acf/)[Register custom block styles in a classic theme](/kb/wordpress/block-styles-classic-themes/)[Run WordPress cron from the system scheduler](/kb/wordpress/wordpress-cron/)[Split a child theme's functions.php into included files](/kb/wordpress/child-theme-file-includes/)[WordPress database optimization queries](/kb/wordpress/database-optimization-queries/)[WordPress debugging snippets](/kb/wordpress/debugging-snippets/)[WP-CLI cookbook](/kb/wordpress/wp-cli-cookbook/)[wp-config.php reference](/kb/wordpress/wp-config-reference/)

Other sections[Frappe](/kb/frappe/)[ERPNext](/kb/erpnext/)[Odoo](/kb/odoo/)[NixOS](/kb/nixos/)[Email](/kb/email/)[Linux](/kb/linux/)[Databases](/kb/databases/)[Containers](/kb/containers/)[Proxmox](/kb/proxmox/)[Git & Dev Tools](/kb/git-and-dev-tools/)

WordPressRegister custom block styles in a classic theme

Add selectable block style variations to core and third-party blocks from a classic or child theme, with one stylesheet per style.

UpdatedOct 1, 2026

Applies toWordPress 6.x

Tagswordpressblock-editorthemescss

Reading time4 min

On this page[How It Works](#how-it-works)[Folder Layout](#folder-layout)[Register the Styles](#register-the-styles)[Write the CSS](#write-the-css)[Remove or Replace a Style](#remove-or-replace-a-style)

Block styles are the "Styles" options that appear in the block sidebar (for example "Outline" on a Button). A classic theme or child theme can register its own so editors can apply consistent design treatments without writing CSS classes by hand. Use this pattern when a site has a classic theme but editors build pages with the block editor.

## How It Works

`register_block_style()` adds a style to a block. When an editor picks it, WordPress adds the class `is-style-<name>` to the block's wrapper. The style can point to a registered stylesheet through `style_handle`.

When WordPress loads block assets on demand, the stylesheet only loads on pages that render that block. Block themes always do this. On a classic theme, return `true` from the `should_load_separate_core_block_assets` filter to make sure it's on. When on-demand loading is off, the stylesheet loads on every page. Either way, it also loads in the editor so the preview matches the front end.

## Folder Layout

Keep one small CSS file per style, named after the style:

```text
my-child-theme/
├── functions.php
├── inc/
│   └── block-styles.php
└── block-styles/
    ├── button-accent.css
    ├── columns-reversed-mobile.css
    ├── group-feature-left.css
    └── heading-tight.css
```

## Register the Styles

Put this in the child theme (for example in `inc/block-styles.php`, loaded from `functions.php` as shown in [Child Theme File Includes](/kb/wordpress/child-theme-file-includes/)). Each entry maps a style name to its blocks and the label editors see.

```
<span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E"><?</span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">php</span>
<span style="--shiki-dark:#8B949E;--shiki-light:#6E7781">/**</span>
<span style="--shiki-dark:#8B949E;--shiki-light:#6E7781"> * Register custom block styles. Each style loads block-styles/<name>.css.</span>
<span style="--shiki-dark:#8B949E;--shiki-light:#6E7781"> */</span>
<span style="--shiki-dark:#D2A8FF;--shiki-light:#8250DF">add_action</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'init'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">function</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> () {</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">	$styles </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> [</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		</span><span style="--shiki-dark:#8B949E;--shiki-light:#6E7781">// name                       => [ block(s), label ]</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'button-accent'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">             </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=></span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> [ </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'core/button'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'Accent'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> ],</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'columns-reversed-mobile'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">   </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=></span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> [ </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'core/columns'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'Reversed on Mobile'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> ],</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'columns-spaced'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">            </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=></span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> [ </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'core/columns'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'Spaced'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> ],</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'gallery-portfolio'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">         </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=></span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> [ </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'core/gallery'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'Portfolio'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> ],</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'group-feature-left'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">        </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=></span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> [ </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'core/group'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'Left Feature'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> ],</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'heading-tight'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">             </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=></span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> [ </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'core/heading'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'No Top Margin'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> ],</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'image-free-width'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">          </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=></span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> [ </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'core/image'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'Free Width'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> ],</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'paragraph-subtitle'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">        </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=></span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> [ </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'core/paragraph'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'Subtitle'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> ],</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		</span><span style="--shiki-dark:#8B949E;--shiki-light:#6E7781">// Third-party blocks work too.</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'contact-form-inline'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">       </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=></span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> [ </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'contact-form-7/contact-form-selector'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'Inline Controls'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> ],</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		</span><span style="--shiki-dark:#8B949E;--shiki-light:#6E7781">// WordPress 6.6+ accepts several blocks for one style.</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'padded-bottom'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">             </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=></span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> [ [ </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'core/group'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'core/columns'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> ], </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'Padded Bottom'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> ],</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">	];</span>

<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">	</span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">foreach</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> ( $styles </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">as</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> $name </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=></span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> [ $blocks, $label ] ) {</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		$file </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">"/block-styles/{</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">$name</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">}.css"</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">;</span>

<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		</span><span style="--shiki-dark:#D2A8FF;--shiki-light:#8250DF">wp_register_style</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">(</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">			</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">"block-style-{</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">$name</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">}"</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">,</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">			</span><span style="--shiki-dark:#D2A8FF;--shiki-light:#8250DF">get_theme_file_uri</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( $file ),</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">			[],</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">			</span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">filemtime</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#D2A8FF;--shiki-light:#8250DF">get_theme_file_path</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( $file ) )</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		);</span>

<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		</span><span style="--shiki-dark:#D2A8FF;--shiki-light:#8250DF">register_block_style</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">(</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">			$blocks,</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">			[</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">				</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'name'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">         </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=></span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> $name,</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">				</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'label'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">        </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=></span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> $label,</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">				</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'style_handle'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=></span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">"block-style-{</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">$name</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">}"</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">,</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">			]</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		);</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">	}</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">} );</span>
```

Notes:

`get_theme_file_uri()` and `get_theme_file_path()` look in the child theme first and fall back to the parent, so the parent theme can provide a default file.

Using `filemtime()` as the version busts browser caches whenever you edit a stylesheet.

Passing an array of block names needs WordPress 6.6 or later. On older versions, register the style once per block.

`register_block_style()` has existed since WordPress 5.3, so you don't need the `function_exists()` guard that older snippets used.

## Write the CSS

Target the `is-style-<name>` class that WordPress adds. For example, `block-styles/columns-reversed-mobile.css`:

```
<span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">@media</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> (</span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">max-width</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">: </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">781</span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">px</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">) {</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">	</span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">.wp-block-columns.is-style-columns-reversed-mobile</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> {</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">		</span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">flex-direction</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">: </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">column-reverse</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">;</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">	}</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">}</span>
```

Tip

For a style that needs only a line or two of CSS, skip the file and pass `'inline_style' => '.is-style-heading-tight { margin-top: 0; }'` instead of `style_handle`.

## Remove or Replace a Style

`unregister_block_style()` only removes styles that were registered in PHP with `register_block_style()`, such as one added by a parent theme or plugin. Run it after the original registration:

```
<span style="--shiki-dark:#D2A8FF;--shiki-light:#8250DF">add_action</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'init'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">function</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> () {</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">	</span><span style="--shiki-dark:#D2A8FF;--shiki-light:#8250DF">unregister_block_style</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'core/group'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'parent-theme-card'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> );</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">}, </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">20</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> );</span>
```

Core styles (for example the Button block's "Outline") are defined in each block's `block.json` and handled in the editor, so remove those from an editor script instead:

```
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">wp.</span><span style="--shiki-dark:#D2A8FF;--shiki-light:#8250DF">domReady</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( () </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=></span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> {</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">	wp.blocks.</span><span style="--shiki-dark:#D2A8FF;--shiki-light:#8250DF">unregisterBlockStyle</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'core/button'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'outline'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> );</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">} );</span>
```

Enqueue that script on the `enqueue_block_editor_assets` action with `wp-blocks` and `wp-dom-ready` as dependencies.

Sources

- [developer.wordpress.org/reference/functions/register_block_style](https://developer.wordpress.org/reference/functions/register_block_style/)
- [developer.wordpress.org/block-editor/reference-guides/block-api/block-styles](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-styles/)

Need help with WordPress?

Our notes can take you a long way, but sometimes you'd rather have someone who's done it before.

[Websites](/services/websites/)

[← PreviousPopulate Gravity Forms image choices from an ACF image field](/kb/wordpress/gravity-forms-image-choices-acf/)[Next →Run WordPress cron from the system scheduler](/kb/wordpress/wordpress-cron/)

CC0This article is in the public domain ([CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/)), code samples included. Use it however helps you.

On this page

- [How It Works](#how-it-works)
- [Folder Layout](#folder-layout)
- [Register the Styles](#register-the-styles)
- [Write the CSS](#write-the-css)
- [Remove or Replace a Style](#remove-or-replace-a-style)

[Back to top↑](#top)

Services

- [ERP implementation](/services/erp/)
- [Odoo](/services/erp/odoo/)
- [ERPNext](/services/erp/erpnext/)
- [Custom software](/services/custom-software/)
- [Devices & IoT](/services/devices-iot/)
- [Websites](/services/websites/)
- [Infrastructure](/services/infrastructure/)

Resources

- [Our work](/work/)
- [Open source](/open-source/)
- [Knowledge base](/kb/)
- [Insights](/insights/)

Company

- [About](/about/)
- [Team](/about/team/)
- [Partners](/partners/)
- [Contact](/contact/)

Clients

- [Project portal](https://erp.avunu.net/projects)
- [Invoices](https://erp.avunu.net/)
- [Support](https://erp.avunu.net/)

[![Avunu](/brand/avunu-logo-light.svg)](/)[\<av-icon data-jx-static>\<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor" stroke="none" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">\<path d="M20.400 20.500h-3.600v-5.600c0-1.300 0-3-1.800-3s-2.100 1.400-2.100 2.900v5.700H9.400V9h3.400v1.600c.5-.9 1.600-1.900 3.400-1.900 3.600 0 4.300 2.400 4.300 5.500v6.300zM5.300 7.400a2.100 2.100 0 1 1 0-4.100 2.100 2.100 0 0 1 0 4.100zm1.800 13.100H3.600V9h3.500v11.500zM22.200 0H1.800C.8 0 0 .8 0 1.700v20.600c0 .9.800 1.700 1.800 1.700h20.400c1 0 1.800-.8 1.800-1.700V1.700C24 .8 23.200 0 22.200 0z">\</path>\</svg>\</av-icon>](https://www.linkedin.com/company/avunu)[\<av-icon data-jx-static>\<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor" stroke="none" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">\<path d="M12 .3a12 12 0 0 0-3.8 23.4c.6.1.8-.3.8-.6v-2c-3.3.7-4-1.6-4-1.6-.6-1.4-1.4-1.8-1.4-1.8-1-.7.1-.7.1-.7 1.2.1 1.8 1.2 1.8 1.2 1 1.8 2.8 1.3 3.5 1 .1-.8.4-1.3.7-1.6-2.7-.3-5.5-1.3-5.5-5.9 0-1.3.5-2.4 1.2-3.2-.1-.3-.5-1.5.1-3.2 0 0 1-.3 3.3 1.2a11.500 11.500 0 0 1 6 0c2.300-1.500 3.300-1.200 3.300-1.200.6 1.700.2 2.900.1 3.200.8.8 1.200 1.900 1.200 3.200 0 4.600-2.800 5.600-5.500 5.900.4.400.8 1.100.8 2.200v3.300c0 .3.2.7.8.6A12 12 0 0 0 12 .3">\</path>\</svg>\</av-icon>](https://github.com/Avunu)[Client portal](https://erp.avunu.net/projects)[Start a project](/start/)

Avunu LLC · 948 East Philadelphia Street, York, PA 17403 · (717) 814-8540Knowledge base articles are in the public domain[Privacy](/privacy/)[Terms](/terms/)
