Unlock Hidden Power: 6 Little-Known Ways to Master Custom Block Styles in WordPress
This method for defining block styles uses “a theme.json
-like object,” meaning an array of nested styles in a format that very closely resembles the styles section of the theme.json
file. At the root level, the styles are applied to the block(s) that you define with the block_name
array.
If you are familiar with theme.json
structure, you can use this method to add additional styles. This method enables those styles in Editor → Styles → Blocks and users can make changes there.
As you can see, the array notation for this parameter follows JSON closely.