Make WordPress Core

Opened 3 months ago

Closed 2 months ago

Last modified 6 weeks ago

#61165 closed enhancement (fixed)

Reduce specificity of global styles and layout selectors

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

Description (last modified by isabel_brison)

In order to enable the extension of block style variations to allow for section styling as described here: https://github.com/WordPress/gutenberg/issues/57537, it is necessary to reduce the specificity of global styles CSS output.

The following PRs need to be synced to core:

https://github.com/WordPress/gutenberg/pull/60106
https://github.com/WordPress/gutenberg/pull/60228
https://github.com/WordPress/gutenberg/pull/61340
https://github.com/WordPress/gutenberg/pull/61638

Change History (14)

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


3 months ago
#1

  • Keywords has-patch has-unit-tests added

@isabel_brison commented on PR #6522:


3 months ago
#2

Just realised that changes from #6489 are likely to conflict with these, especially the test string updates, so I might hold off on updating this one until #6489 is committed.

@isabel_brison commented on PR #6522:


3 months ago
#3

PHP tests are updated, so marking this ready for review!

@aaronrobertshaw commented on PR #6522:


2 months ago
#4

There are some proposed changes to specificity in https://github.com/WordPress/gutenberg/pull/61638 and a general consensus to proceed with those changes for WP6.6.

Given the tight timeline until the 6.6 beta I've put together a separate draft PR bringing together all the specificity changes from the following PRs:

Once they settle that could be rolled into this PR or the core ticket updated to point to the alternate backport.

@isabel_brison commented on PR #6522:


2 months ago
#5

Closing in favour of #6633.

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


2 months ago
#6

To make overriding core styles easier and enable the extension of block style variations as a means for section styling, it is necessary to limit the specificity of global styles CSS output.

Further context can be found in: https://github.com/WordPress/gutenberg/issues/57537

Syncs changes from:

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

#7 @isabel_brison
2 months ago

  • Description modified (diff)

@aaronrobertshaw commented on PR #6633:


2 months ago
#8

@tellthemachines and @andrewserong, if you get the chance, it would be great if you could confirm this backport covers all it should from previous zero-specificity work and the closed PR: https://github.com/WordPress/wordpress-develop/pull/6522

@aaronrobertshaw commented on PR #6633:


2 months ago
#9

Thanks for the reviews and nudge to get the since/ticket comments in place. That's been done now.

I've also given this a rebase and updated the new background image test for theme.json.

#10 @isabel_brison
2 months ago

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

In 58241:

Editor: level global styles specificity at 0-1-0.

Adjusts the block level global styles selectors so they have a consistent specificity of 0-1-0, and adjusts base and layout global style selectors to their minimum required specificity.

Props aaronrobertshaw, isabel_brison, andrewserong, mukesh27.
Fixes #61165.

@isabel_brison commented on PR #6633:


2 months ago
#11

Committed in r58241.

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


6 weeks ago
#12

Backports the default block style variation styles to the core theme.json file after the general specificity reduction of global styles in https://github.com/WordPress/gutenberg/pull/61638.

To test:

  1. Prior to checking out this branch, visit the site editor and edit the home page with TT4 active
  2. Select the button and switch its block style to Outline. Note the appearance doesn't change.
  3. Checkout this branch and repeat the steps. The Outline style should take effect.

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

#13 @isabel_brison
6 weeks ago

In 58393:

Editor: Fix specificity of core block style variations.

Adds styles for default block style variations to core theme.json so they can override core element styles where needed.

Props aaronrobertshaw, isabel_brison.
Follows r58241.
See #61165.

@isabel_brison commented on PR #6787:


6 weeks ago
#14

Committed in r58393.

Note: See TracTickets for help on using tickets.