• When registering any block style for this block, the editor breaks because the automatically-applied style class is merged with the block class.

    Style registration example:

    
    register_block_style(
    	'jetpack/layout-grid',
    	array(
    		'name' => 'mobile-reversed',
    		'label' => 'Reversed column order on mobile'
    	)
    );
    

    Once you choose a block style in the editor, the block formatting breaks, and choosing the default style does not fix the issue because an “is-default-style” class is added. In the case of the above custom style, the classname on the block becomes:

    wp-block-jetpack-layout-gridis-style-mobile-reversed

    And when choosing the default style:

    wp-block-jetpack-layout-gridis-style-default

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Registering a block style breaks the editor’ is closed to new replies.