Skip to content

Commit

Permalink
Make selector include the where to be fully consistent with theme.json
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Feb 16, 2024
1 parent 52a2e9a commit dc898bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/block-supports/elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ function gutenberg_render_elements_support_styles( $pre_render, $block ) {
'skip' => $skip_button_color_serialization,
),
'link' => array(
'selector' => ".$class_name a:not(.wp-element-button)",
'hover_selector' => ".$class_name a:not(.wp-element-button):hover",
// :where(:not) matches theme.json selector.
'selector' => ".$class_name a:where(:not(.wp-element-button))",
'hover_selector' => ".$class_name a:where(:not(.wp-element-button)):hover",
'skip' => $skip_link_color_serialization,
),
'heading' => array(
Expand Down
4 changes: 2 additions & 2 deletions phpunit/block-supports/elements-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ public function data_elements_block_support_styles() {
),
),
),
'expected_styles' => '/^.wp-elements-[a-f0-9]{32} a:not\(.wp-element-button\)' . $color_css_rules .
'.wp-elements-[a-f0-9]{32} a:not\(.wp-element-button\):hover' . $color_css_rules . '$/',
'expected_styles' => '/^.wp-elements-[a-f0-9]{32} a:where\(:not\(.wp-element-button\)\)' . $color_css_rules .
'.wp-elements-[a-f0-9]{32} a:where\(:not\(.wp-element-button\)\):hover' . $color_css_rules . '$/',
),
'generic heading element styles are applied' => array(
'color_settings' => array( 'heading' => true ),
Expand Down

0 comments on commit dc898bb

Please sign in to comment.