Opened 6 weeks ago
Last modified 6 weeks ago
#62624 new defect (bug)
Fix global styles for Separator blocks when theme defines non-background colors
Reported by: | aaronrobertshaw | Owned by: | |
---|---|---|---|
Milestone: | 6.8 | Priority: | normal |
Severity: | normal | Version: | trunk |
Component: | Editor | Keywords: | gutenberg-merge has-patch has-unit-tests |
Focuses: | Cc: |
Description
This ticket tracks the backport of PHP files for the following Gutenberg updates:
https://github.com/WordPress/gutenberg/pull/67269
These updates include a fix so a user's selection of background color for the Separator block in Global Styles is honored regardless of whether a theme also defines non-background colors for that block.
Further background and context is available within the original issue:
Change History (1)
This ticket was mentioned in PR #7927 on WordPress/wordpress-develop by @aaronrobertshaw.
6 weeks ago
#1
- Keywords has-patch has-unit-tests added
Note: See
TracTickets for help on using
tickets.
Trac ticket: https://core.trac.wordpress.org/ticket/62624
This PR brings the changes from the following Gutenberg PRs to core:
### Description
Removes the old fudging of style declarations for Separator block styles in favour of a more robust and consistent approach within the theme.json revolver.
The Separator block styles are now tweaked within the theme.json resolver's
get_theme_data
andget_user_data
methods. This allows a subtle difference in handling based on the origin of the user data.Theme data (from theme.json) containing a background color style for the Separator block will now use that as a fallback for
color.text
andborder.color
style paths. This allows the Separator block's different rendering approaches that rely on different CSS properties to use a consistent color.User origin data, such as a color selection made in Global Styless, is now enforced across the different color paths. This means the user's selection is now honoured regardless of which block style, and therefore rendering method the Separator block employs.
A more detailed breakdown and discussion can be found on the GB PR: https://github.com/WordPress/gutenberg/pull/67269
### Test Instructions
### Screenshots
#### Before
_Note the overlaid color on top of the user-selected yellow in the above screenshot. This is due to the theme's styles not being overridden for non-background properties on trunk._
#### After