Last active
October 10, 2022 11:34
-
-
Save atanasantonov/cf324b1b5dd4201963e3ded951791981 to your computer and use it in GitHub Desktop.
Block style container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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