mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Editor: Fix instance element styles for links applying to buttons.
These changes fix the selector used by block instance element styles for links so they do not get incorrectly applied to buttons. Props aaronrobertshaw, freewebmentor, mukesh27. Fixes #60557. git-svn-id: https://develop.svn.wordpress.org/trunk@57664 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c84cddb432
commit
5f37cb1fc7
@ -166,8 +166,8 @@ function wp_render_elements_support_styles( $pre_render, $block ) {
|
||||
'skip' => $skip_button_color_serialization,
|
||||
),
|
||||
'link' => array(
|
||||
'selector' => ".$class_name a",
|
||||
'hover_selector' => ".$class_name a:hover",
|
||||
'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(
|
||||
|
||||
@ -22,6 +22,7 @@ class Tests_Block_Supports_WpRenderElementsSupportStyles extends WP_UnitTestCase
|
||||
* Tests that elements block support generates appropriate styles.
|
||||
*
|
||||
* @ticket 59555
|
||||
* @ticket 60557
|
||||
*
|
||||
* @covers ::wp_render_elements_support_styles
|
||||
*
|
||||
@ -139,8 +140,8 @@ class Tests_Block_Supports_WpRenderElementsSupportStyles extends WP_UnitTestCase
|
||||
),
|
||||
),
|
||||
),
|
||||
'expected_styles' => '/^.wp-elements-[a-f0-9]{32} a' . $color_css_rules .
|
||||
'.wp-elements-[a-f0-9]{32} a: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 ),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user