diff --git a/includes/class-core.php b/includes/class-core.php index b6c96721..89162ec1 100644 --- a/includes/class-core.php +++ b/includes/class-core.php @@ -43,6 +43,7 @@ public function __construct() { \add_action( 'enqueue_block_editor_assets', [ __CLASS__, 'editor_scripts' ] ); \add_filter( 'block_type_metadata', [ __CLASS__, 'block_variations' ] ); \add_action( 'init', [ __CLASS__, 'block_pattern_categories' ] ); + \add_action( 'init', [ __CLASS__, 'register_block_styles' ] ); } /** @@ -148,6 +149,21 @@ public static function block_pattern_categories() { ) ); } + + /** + * Register new block styles. + * + * @since Newspack Block Theme 1.0 + */ + public static function register_block_styles() { + register_block_style( + 'core/column', + array( + 'name' => 'rounded', + 'label' => __( 'Rounded', 'newspack-block-theme' ), + ) + ); + } } Core::instance(); diff --git a/src/scss/block-styles/_block-styles.scss b/src/scss/block-styles/_block-styles.scss index 72a25492..cce01e9b 100644 --- a/src/scss/block-styles/_block-styles.scss +++ b/src/scss/block-styles/_block-styles.scss @@ -1,2 +1,3 @@ +@import url('./_column-styles.scss'); @import url('./_navigation-styles.scss'); @import url('./_separator-styles.scss'); diff --git a/src/scss/block-styles/_column-styles.scss b/src/scss/block-styles/_column-styles.scss new file mode 100644 index 00000000..fd0f9166 --- /dev/null +++ b/src/scss/block-styles/_column-styles.scss @@ -0,0 +1,5 @@ +.wp-block-column { + &.is-style-rounded { + border-radius: var( --wp--custom--border--radius-medium ); + } +}