[wp-trac] [WordPress Trac] #61769: Global Styles: Prevent empty CSS rules and malformed selectors for custom css for blocks
WordPress Trac
noreply at wordpress.org
Wed Sep 4 14:22:33 UTC 2024
#61769: Global Styles: Prevent empty CSS rules and malformed selectors for custom
css for blocks
-------------------------------------------------+-------------------------
Reporter: aaronrobertshaw | Owner:
| hellofromTonya
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 6.6.2
Component: Editor | Version: 6.6
Severity: normal | Resolution: fixed
Keywords: gutenberg-merge has-patch has-unit- | Focuses:
tests has-testing-info commit fixed-major |
dev-reviewed |
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):
* status: reopened => closed
* resolution: => fixed
Comment:
In [changeset:"58987" 58987]:
{{{
#!CommitTicketReference repository="" revision="58987"
Editor: Fix block custom CSS pseudo element selectors in global styles.
Fixes a regression introduced in [58241] where selectors with pseudo
elements are wrapped within `:where()` causing malformed CSS and the CSS
rule(s) not being applied.
When processing custom CSS for blocks, this changeset:
* Strips the pseudo-elements from the original nested selector, performs
the required wrapping in `:root :where`, then re-appends the pseudo-
element selector with its leading combinators if present.
* Removes empty CSS rules.
It includes the PHP changes.
Reference:
* PHP changes from [https://github.com/WordPress/gutenberg/pull/63980
Gutenberg PR 63980].
Follow-up to [58241], [56812], [55216].
Reviewed by andrewserong.
Merges [58896] to the 6.6 branch.
Props aaronrobertshaw, wongjn, harlet7, dballari, ramonopoly,
andrewserong, aristath, hellofromTonya.
Fixes #61769.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61769#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list