Skip to content

Commit

Permalink
Buttons: Update selectors to work better with button elements (#43022)
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian authored Aug 10, 2022
1 parent 8067e99 commit ee477b9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,15 @@ function gutenberg_register_core_block_assets( $block_name ) {
wp_register_style(
"wp-block-{$block_name}",
gutenberg_url( $style_path ),
array( 'global-styles' ),
array(),
$default_version
);
wp_style_add_data( "wp-block-{$block_name}", 'rtl', 'replace' );

// Add a reference to the stylesheet's path to allow calculations for inlining styles in `wp_head`.
wp_style_add_data( "wp-block-{$block_name}", 'path', gutenberg_dir_path() . $style_path );
} else {
wp_register_style( "wp-block-{$block_name}", false, array( 'global-styles' ) );
wp_register_style( "wp-block-{$block_name}", false, array() );
}

// If the current theme supports wp-block-styles, dequeue the full stylesheet
Expand Down Expand Up @@ -246,7 +246,7 @@ function() {
wp_register_style(
"wp-block-{$block_name}",
gutenberg_url( $theme_style_path ),
array( 'global-styles' ),
array(),
$default_version
);
wp_style_add_data( "wp-block-{$block_name}", 'path', gutenberg_dir_path() . $theme_style_path );
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/button/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"radius": true
}
},
"__experimentalSelector": ".wp-block-button__link"
"__experimentalSelector": ".wp-block-button .wp-block-button__link"
},
"styles": [
{ "name": "fill", "label": "Fill", "isDefault": true },
Expand Down
12 changes: 6 additions & 6 deletions packages/block-library/src/button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,18 @@ $blocks-block__margin: 0.5em;
border-radius: 0 !important;
}

.is-style-outline > :where(.wp-block-button__link),
:where(.wp-block-button__link).is-style-outline {
.wp-block-button.is-style-outline > .wp-block-button__link,
.wp-block-button .wp-block-button__link.is-style-outline {
border: 2px solid currentColor;
padding: 0.667em 1.333em;
}

.is-style-outline > .wp-block-button__link:not(.has-text-color),
.wp-block-button__link.is-style-outline:not(.has-text-color) {
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color),
.wp-block-button .wp-block-button__link.is-style-outline:not(.has-text-color) {
color: currentColor;
}

.is-style-outline > .wp-block-button__link:not(.has-background),
.wp-block-button__link.is-style-outline:not(.has-background) {
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background),
.wp-block-button .wp-block-button__link.is-style-outline:not(.has-background) {
background-color: transparent;
}

0 comments on commit ee477b9

Please sign in to comment.