Skip to content

Instantly share code, notes, and snippets.

@atanasantonov
Last active October 10, 2022 11:34
Show Gist options
  • Save atanasantonov/cf324b1b5dd4201963e3ded951791981 to your computer and use it in GitHub Desktop.
Save atanasantonov/cf324b1b5dd4201963e3ded951791981 to your computer and use it in GitHub Desktop.
Block style container
/**
* Register block styles.
*/
function prefix_register_block_styles() {
$blocks = array(
'columns',
'coverImage',
'group',
'gallery',
'heading',
'html',
'image',
'paragraph',
'shortcode',
'subhead',
'table',
'textColumns',
'video',
);
foreach ( $blocks as $block ) {
register_block_style(
'core/' . $block,
array(
'name' => 'container',
'label' => __( 'Container', 'textdomain' ),
)
);
}
}
prefix_register_block_styles();
/**
* Bootstrap 5 Scss.
*/
.container,
.is-style-container {
max-width: 100%;
margin: 0 auto;
padding: 0 15px;
@include make-container();
padding: 0 15px;
@include media-breakpoint-up(lg) {
max-width: map-get( $container-max-widths, xl );
padding: 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment