Make WordPress Core

Opened 6 months ago

Closed 6 months ago

Last modified 6 months ago

#60312 closed enhancement (fixed)

Reduce specificity of block style variation selectors

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

Description

Syncs https://github.com/WordPress/gutenberg/pull/57659 from Gutenberg. Reduces the specificity of the generated selectors for block style variations in WP_Theme_JSON class.

Change History (6)

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


6 months ago
#1

  • Keywords has-patch added

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

Syncs https://github.com/WordPress/gutenberg/pull/57659. This change will only be fully testable in core once the npm packages are updated, given that there's a matching specificity reduction in block library styles. Without that package update, core styles for the Button block may override some of its variation styles.

@isabel_brison commented on PR #5917:


6 months ago
#2

Thanks for the reviews folks!

I'm curious why the chaining was initially implemented here and if this risks introducing a style regression that this was meant to fix

Initially the chaining was meant to override some overly-specific block library styles. These have been progressively reduced in specificity, and the Button one that is changed in the Gutenberg PR was the last remaining style requiring the chaining. With that change, we're safe to remove the chaining too.

@mukesh27 commented on PR #5917:


6 months ago
#3

The code looks fine, but I'm curious why the chaining was initially implemented here and if this risks introducing a style regression that this was meant to fix?

If someone override similar CSS selector in CSS file previously then it will not affect previously but after these changes it will get affected.

@get_dave commented on PR #5917:


6 months ago
#4

Note for release PHP syncing purposes we should delay committing this as per this comment.

#5 @isabel_brison
6 months ago

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

In 57490:

Editor: reduce specificity of block style variation selector.

Removes duplicate classname from the block style variation selector generated in WP_Theme_JSON’s get_blocks_metadata function.

Props flixos90, joemcgill, mukesh27, isabel_brison.
Fixes #60312.

@isabel_brison commented on PR #5917:


6 months ago
#6

Committed in r57490.

Note: See TracTickets for help on using tickets.