Twenty Thirteen: Add "No Shadow" style to button block.

This creates a new block style without a shadow, and fixes colors on outline buttons.

Props melchoyce, kjellr, scruffian.
Fixes #51223.



git-svn-id: https://develop.svn.wordpress.org/trunk@51110 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Kelly Choyce-Dwan
2021-06-08 20:36:36 +00:00
parent b98d11e680
commit cea3994d29
3 changed files with 40 additions and 4 deletions

View File

@@ -370,15 +370,20 @@ body:not(.sidebar) .wp-block-table.alignfull {
.entry-content .wp-block-button__link:hover,
.entry-content .wp-block-button__link:focus,
.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color):hover,
.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color):focus {
.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color):focus,
.wp-block-button.is-style-outline .wp-block-button__link:not(.has-background):hover,
.wp-block-button.is-style-outline .wp-block-button__link:not(.has-background):focus {
background: #ed6a31;
color: #fff;
}
.wp-block-button.is-style-outline .wp-block-button__link {
background-color: inherit;
border-color: inherit;
border-width: 2px;
border-color: inherit;
}
.wp-block-button.is-style-outline .wp-block-button__link:not(.has-background) {
background-color: inherit;
}
.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color) {
@@ -407,6 +412,10 @@ body:not(.sidebar) .wp-block-table.alignfull {
padding: 10px 24px 11px;
}
.entry-content .wp-block-button.is-style-no-shadow .wp-block-button__link {
border-bottom: none;
}
/* Separator */
.wp-block-separator {

View File

@@ -351,7 +351,7 @@ p.has-drop-cap:not(:focus)::first-letter {
color: #fff;
}
.is-style-outline .wp-block-button__link {
.is-style-outline .wp-block-button__link:not(.has-text-color) {
border-width: 2px;
color: #e05d22;
}
@@ -361,6 +361,10 @@ p.has-drop-cap:not(:focus)::first-letter {
background: linear-gradient(to bottom, #e05d22 0%, #d94412 100%); /* W3C */
}
.wp-block-button.is-style-no-shadow .wp-block-button__link {
border-bottom: none;
}
/* Separator */
.editor-block-list__block hr.wp-block-separator {

View File

@@ -835,3 +835,26 @@ if ( ! function_exists( 'wp_body_open' ) ) :
do_action( 'wp_body_open' );
}
endif;
/**
* Register Custom Block Styles
*
* @since Twenty Thirteen 3.4
*/
if ( function_exists( 'register_block_style' ) ) {
function twentythirteen_register_block_styles() {
/**
* Register block style
*/
register_block_style(
'core/button',
array(
'name' => 'no-shadow',
'label' => __( 'No Shadow', 'twentythirteen' ),
'style_handle' => 'no-shadow',
)
);
}
add_action( 'init', 'twentythirteen_register_block_styles' );
}