I’m sure there are other ways e.g. with CSS only or Add custom class to core blocks in Gutenberg, but regarding:
Add a containing DIV to core Gutenberg blocks
one way could be with the render_block
filter:
add_filter( 'render_block', function( $block_content, $block ) {
// Target core/* and core-embed/* blocks.
if ( preg_match( '~^core/|core-embed/~', $block['blockName'] ) ) {
$block_content = sprintf( '<div class="some__class">%s</div>', $block_content );
}
return $block_content;
}, PHP_INT_MAX - 1, 2 );
to div-wrap the core blocks on the frontend.
Changing the HTML layout might affect the current style of the site.