Make WordPress Core

Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#60557 closed defect (bug) (fixed)

Elements: Fix block instance element styles for links applying to buttons

Reported by: aaronrobertshaw's profile aaronrobertshaw Owned by: youknowriad's profile youknowriad
Milestone: 6.5 Priority: normal
Severity: normal Version: 6.5
Component: Editor Keywords: gutenberg-merge has-patch has-unit-tests
Focuses: Cc:

Description

This ticket tracks the backporting of PHP files for the following Gutenberg changes:

https://github.com/WordPress/gutenberg/pull/59114

The previous selector used for link styles set on an individual block instance simply used the a element. This meant it incorrectly was applied to buttons as well.

The linked Gutenberg PR fixes this by updating the selector to match the one used in theme.json i.e. a:where(:not(.wp-element-button)).

Change History (4)

This ticket was mentioned in PR #6127 on WordPress/wordpress-develop by @aaronrobertshaw.


3 months ago
#1

  • Keywords has-patch has-unit-tests added

Syncs the changes from https://github.com/WordPress/gutenberg/pull/59114

These changes fix the selector used by block instance element styles for links so they do not get incorrectly applied to buttons.

To test:

  1. Run: npm run test:php -- --filter Tests_Block_Supports_WpRenderElementsSupport
  2. Edit a post, add a group block containing a paragraph with a link and a button
  3. Select the group block and apply a color to links within that block
  4. Save and view the post on the frontend, the button's color should match the editor and not be impacted by the link color previously selected

Trac ticket: https://core.trac.wordpress.org/ticket/60557

#2 @youknowriad
3 months ago

  • Owner set to youknowriad
  • Resolution set to fixed
  • Status changed from new to closed

In 57664:

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.

#4 @youknowriad
3 months ago

  • Milestone changed from Awaiting Review to 6.5
Note: See TracTickets for help on using tickets.