What is a custom block style?

A custom block style is a style change that is applied to a WordPress block to make it look different from the default styles.

The difference between a custom block style and a custom block, is that the style is added to existing blocks, while custom blocks are new blocks that may add new functionality. It is usually simpler to create custom styles than entire blocks.

The custom block style can then be selected in the WordPress editor:

An image describing the settings for the gallery block in the WordPress editor. A new block style called Hide captions is available for selection.
Example of a custom style added to a gallery block.

How a custom style is added

The code to add the styles consists of JavaScript, CSS and two PHP functions. It can be included in your theme, child theme, or a plugin.

The JavaScript adds the functionality to the editor that lets you select the new style. The CSS is used both in the editor and the front.

If you want to know more, you can continue with this tutorial: How to add a block style to a child theme.