#61769 closed defect (bug) (fixed)
Global Styles: Prevent empty CSS rules and malformed selectors for custom css for blocks
Reported by: | aaronrobertshaw | Owned by: | hellofromTonya |
---|---|---|---|
Milestone: | 6.6.2 | Priority: | normal |
Severity: | normal | Version: | 6.6 |
Component: | Editor | Keywords: | gutenberg-merge has-patch has-unit-tests has-testing-info commit fixed-major dev-reviewed |
Focuses: | Cc: |
Description (last modified by )
This ticket tracks the merging of PHP files for the following Gutenberg changes:
These changes fix two issues with the generation of custom css for blocks with Global Styles.
- Empty CSS rules e.g.
:root :where(.wp-block-heading){}
- Malformed pseudo element selectors
:root :where(.wp-block-heading::before)
Change History (17)
This ticket was mentioned in PR #7097 on WordPress/wordpress-develop by @aaronrobertshaw.
7 weeks ago
#1
- Keywords has-patch has-unit-tests added
@ramonopoly commented on PR #7097:
6 weeks ago
#2
I tested along the lines of https://github.com/WordPress/gutenberg/pull/63980 also LGTM
Thanks for reviewing so quickly, folks!
#3
@
5 weeks ago
- Owner set to hellofromTonya
- Status changed from new to reviewing
- Version changed from trunk to 6.6
Changing the version to 6.6.0 as it appears [56812] introduced the bug.
Self-assigning for review and commit.
#4
@
4 weeks ago
- Keywords has-testing-info added
Test Report
This report validates that the indicated patch addresses the issue.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/7097
Environment
- OS: macOS
- Web Server: Core's Docker instance
- PHP: 7.4.29
- WordPress: 6.7-alpha-58576-src
- Browser: Firefox 129.0.1
- Theme: Twenty Twenty-Four
- Active Plugins: None
Actual Results
When reproducing a bug/defect:
- ❌ 'Foo' is not added to the start of each header.
- ❌ the generated CSS is not expected:
:root :where(.wp-block-heading::before ){content: 'Foo'}
Also noting, the following empty CSS exists, which is not expected:
:root :where(.wp-block-heading){}
When testing the bugfix patch:
- ✅ 'Foo' is added to the start of each header.
- ✅ The generated CSS is as expected.
:root :where(.wp-block-heading)::before{content: 'Foo'}
- ✅ The empty CSS no longer exists.
Observations
Using the provided testing instructions, I'm able to reproduce the reported issue and the patch resolves it.
#5
@
4 weeks ago
- Keywords commit added
Patch: https://github.com/WordPress/wordpress-develop/pull/7097
- ✅ Tests well for me (see test report).
- ✅ There are multiple test reports and approvals in the PR and the original Gutenberg PR.
- ✅ All PHP changes from the original Gutenberg PR are included.
LGTM for commit 👍
@hellofromTonya commented on PR #7097:
4 weeks ago
#7
Committed to trunk
via https://core.trac.wordpress.org/changeset/58896.
#8
@
4 weeks ago
- Keywords fixed-major dev-feedback added
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening for 2nd committer sign-off to backport [58896] to the 6.6 branch.
This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.
3 weeks ago
This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.
2 weeks ago
#11
@
10 days ago
- Description modified (diff)
Pinging committers involved in this change for a 2nd committer sign-off to backport it to the 6.6. branch for 6.6.2 RC1 on Sep 4th.
@aaronrobertshaw @andrewserong @talldanwp
This ticket was mentioned in Slack in #core-editor by hellofromtonya. View the logs.
10 days ago
#13
@
10 days ago
- Keywords dev-reviewed added; dev-feedback removed
I've re-tested https://github.com/WordPress/wordpress-develop/pull/7097 applied on the 6.6 branch and it's all working correctly. Adding the dev-reviewed
keyword, marking this as ready for backporting to the 6.6 branch.
Syncs the changes from https://github.com/WordPress/gutenberg/pull/63980
These updates include the PHP fixes for empty CSS rules and invalid selectors for Global Styles custom CSS for blocks.
Please note: JS package updates will be required to resolve the issue in the editor.
#### Testing Instructions
&::before { content: 'Foo' }
## Screenshots or screencast
Trac ticket: https://core.trac.wordpress.org/ticket/61769