#62471 closed defect (bug) (fixed)
Fix malformed variation selector in theme.json when block uses non-trival CSS selector
| Reported by: | aaronrobertshaw | Owned by: | joemcgill |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.8 |
| Component: | Editor | Version: | 6.9 |
| Severity: | normal | Keywords: | gutenberg-merge, has-patch, has-unit-tests, has-test-info, commit |
| Cc: | Focuses: |
Description
This ticket tracks the backport of PHP files for the following Gutenberg updates:
https://github.com/WordPress/gutenberg/pull/67061
The old approach to converting a block's CSS selectors for block style variations was fairly simplistic. It worked when a block used a simple class based selector however as blocks evolve and the Selectors API is used more, it needs to handle more complex selectors such as the List block's .wp-block-list:not(.wp-block-list .wp-block-list).
The changes in the linked Gutenberg PR prevent generation of malformed block style variation selectors when a block's selector leverages a CSS function such as :not() or chains multiple classes e.g. .wp-block-list.my-custom-class.
Change History (6)
This ticket was mentioned in PR #7825 on WordPress/wordpress-develop by @aaronrobertshaw.
21 months ago
#1
- Keywords has-patch has-unit-tests added
#2
@
21 months ago
- Keywords has-testing-info added
Test report on Github: https://github.com/WordPress/wordpress-develop/pull/7825#pullrequestreview-2449938306
#3
@
18 months ago
- Keywords commit added
- Milestone Awaiting Review → 6.8
- Owner set to
- Status new → accepted
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This PR backports the PHP changes from https://github.com/WordPress/gutenberg/pull/67061
The old approach to converting a block's CSS selectors for block style variations was fairly simplistic. It worked when a block used a simple class based selector however as blocks evolve and the Selectors API is used more, it needs to handle more complex selectors such as the List block's .wp-block-list:not(.wp-block-list .wp-block-list).
The changes in the linked Gutenberg PR prevent generation of malformed block style variation selectors when a block's selector leverages a CSS function such as :not() or chains multiple classes e.g. .wp-block-list.my-custom-class.
Trac ticket: https://core.trac.wordpress.org/ticket/62471
#### Test Instructions
__experimentalSelectorproperty in block.json#### Screenshots