Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(column-block): add rounded block style #170

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 );
}
}