To add a new block style :
<?php
function dsfr_register_block_styles(){
register_block_style(
'core/paragraph',
array(
'name' => 'highlight',
'label' => 'Mise en avant',
)
);
}
add_action( 'init', 'dsfr_register_block_styles' );
The core styles are editable in the theme.json, but not the custom ones.
{
"styles": {
"blocks": {
"core/image": {
"variations": {
"rounded" : {
"border": {
"radius": ".5rem"
}
}
}
}
}
https://fullsiteediting.com/lessons/modifying-block-style-variations-via-theme-json/