Overriding HTML/CSS Classes of “Columns” block from Gutenberg editor
-
I generally use a custom CSS framework such as Bootstrap or UIKit which includes its own much more robust grid system. I would like to use this instead of WordPress’s CSS for the default Column block for starters.
To override the layout of a Widget you just have to put something like this in the functions.php file:
register_sidebar([
‘name’ => esc_html__($section, ‘u3’),
‘id’ => $section,
‘before_widget’ => ‘<div class=”uk-card uk-card-body widget %1$s %2$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3 class=”uk-card-title”>’,
‘after_title’ => ‘</h3>’
]);However, I can’t find any information post-Gutenberg for overriding the Columns Block focused on its default markup/classes.
I’d like to force everything to be inside an extra div for padding purposes as well as override the container/row to use the UIKit styles.
I did find this which may be relevant, https://www.ads-software.com/gutenberg/handbook/designers-developers/developers/filters/block-filters but I do not know Javascript and would like to do it in the functions file unless that isn’t possible. Can anyone steer me in the right direction? Or is creating custom block filters in Javascript the only way?
The page I need help with: [log in to see the link]
- The topic ‘Overriding HTML/CSS Classes of “Columns” block from Gutenberg editor’ is closed to new replies.