Make WordPress Core

Changeset 51110


Ignore:
Timestamp:
06/08/2021 08:36:36 PM (4 years ago)
Author:
ryelle
Message:

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.

Location:
trunk/src/wp-content/themes/twentythirteen
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentythirteen/css/blocks.css

    r50346 r51110  
    371371.entry-content .wp-block-button__link:focus,
    372372.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color):hover,
    373 .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color):focus {
     373.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color):focus,
     374.wp-block-button.is-style-outline .wp-block-button__link:not(.has-background):hover,
     375.wp-block-button.is-style-outline .wp-block-button__link:not(.has-background):focus {
    374376    background: #ed6a31;
    375377    color: #fff;
     
    377379
    378380.wp-block-button.is-style-outline .wp-block-button__link {
     381    border-width: 2px;
     382    border-color: inherit;
     383}
     384
     385.wp-block-button.is-style-outline .wp-block-button__link:not(.has-background) {
    379386    background-color: inherit;
    380     border-color: inherit;
    381     border-width: 2px;
    382387}
    383388
     
    406411    border-top: 3px solid #b93207;
    407412    padding: 10px 24px 11px;
     413}
     414
     415.entry-content .wp-block-button.is-style-no-shadow .wp-block-button__link {
     416    border-bottom: none;
    408417}
    409418
  • trunk/src/wp-content/themes/twentythirteen/css/editor-blocks.css

    r50358 r51110  
    352352}
    353353
    354 .is-style-outline .wp-block-button__link {
     354.is-style-outline .wp-block-button__link:not(.has-text-color) {
    355355    border-width: 2px;
    356356    color: #e05d22;
     
    360360    background: -webkit-linear-gradient(top, #e05d22 0%, #d94412 100%); /* Chrome 10+, Safari 5.1+ */
    361361    background: linear-gradient(to bottom, #e05d22 0%, #d94412 100%); /* W3C */
     362}
     363
     364.wp-block-button.is-style-no-shadow .wp-block-button__link {
     365    border-bottom: none;
    362366}
    363367
  • trunk/src/wp-content/themes/twentythirteen/functions.php

    r51012 r51110  
    836836    }
    837837endif;
     838
     839/**
     840 * Register Custom Block Styles
     841 *
     842 * @since Twenty Thirteen 3.4
     843 */
     844if ( function_exists( 'register_block_style' ) ) {
     845    function twentythirteen_register_block_styles() {
     846
     847        /**
     848         * Register block style
     849         */
     850        register_block_style(
     851            'core/button',
     852            array(
     853                'name'         => 'no-shadow',
     854                'label'        => __( 'No Shadow', 'twentythirteen' ),
     855                'style_handle' => 'no-shadow',
     856            )
     857        );
     858    }
     859    add_action( 'init', 'twentythirteen_register_block_styles' );
     860}
Note: See TracChangeset for help on using the changeset viewer.