Rechercher

Ajouter un style par défault à un bloc Gutenberg existant

Placeholder image
function mytheme_register_block_styles() {
    // Ajouter un style personnalisé "not" au bloc Groupe
    register_block_style(
        'core/group',
        array(
            'name'  => 'note',
            'label' => __('Note Style', 'mytheme'),
            'isDefault' => false, // Optionnel : false pour ne pas le définir comme style par défaut
        )
    );
}
add_action('init', 'mytheme_register_block_styles');
.wp-block-group.is-style-note {
    background-color: #f0f0f0;
    border: 2px dashed #ff0000;
    padding: 20px;
    color: #333;
}