Add your own style option, like "Brand outline" for buttons, to a core block's Styles panel.
add_action( 'init', function (): void {
register_block_style( 'core/button', [
'name' => 'brand-outline',
'label' => 'Brand outline',
'inline_style' => '
.wp-block-button.is-style-brand-outline .wp-block-button__link {
background: transparent;
color: #6F58CA;
border: 2px solid #6F58CA;
}
',
] );
} );
Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.
Block styles are one-click design variations in the block sidebar, like Fill and Outline for buttons. Adding your own lets editors use on-brand designs without touching colour settings.
register_block_style() adds a style to any block. Selecting it adds the class is-style-{name} to the block. The inline_style CSS is loaded on the front end and in the editor whenever the block is used, so you don’t need a separate stylesheet.
.wp-block-button.is-style-… usually does./styles/blocks/ files.Add a Button block. In the sidebar under Styles, “Brand outline” should appear and change the button’s look.