Skip to content

Commit

Permalink
feat(column-block): add rounded block style (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasguillot authored Jun 7, 2024
1 parent ec1842b commit 9ac025f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
16 changes: 16 additions & 0 deletions includes/class-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ] );
}

/**
Expand Down Expand Up @@ -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();
1 change: 1 addition & 0 deletions src/scss/block-styles/_block-styles.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@import url('./_column-styles.scss');
@import url('./_navigation-styles.scss');
@import url('./_separator-styles.scss');
5 changes: 5 additions & 0 deletions src/scss/block-styles/_column-styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.wp-block-column {
&.is-style-rounded {
border-radius: var( --wp--custom--border--radius-medium );
}
}

0 comments on commit 9ac025f

Please sign in to comment.