Global styles: Fix pseudo element output - #12918
Conversation
|
Checked fidelity of WordPress/gutenberg#81265 sync. 👍🏻 Just kicking off tests again - locally there's a failing test for me, going to double check Next I'll merge WordPress/gutenberg#81265, then rebase/review WordPress/gutenberg#81291. Cheers! |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
…g output. The :hover pseudo-class belongs inside the :root :where() wrapper, which is what get_stylesheet() outputs and what the Gutenberg source PRs' tests expect. Outside the wrapper the rule would also gain 0-1-0 specificity, which the :where() wrap exists to avoid.
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
tellthemachines
left a comment
There was a problem hiding this comment.
looks like static analysis needs fixing, but other than that the code changes LGTM!
Working on that now. Thanks for the quick review. I'm using the See: https://wordpress.slack.com/archives/C02RQBWTW/p1786058089019879 |
I can never properly remember how that's supposed to work 😅 but yeah all commits need double dev sign-off at this point |
Good that @talldan got this started for us two 👍🏻 Thanks for confirming |
The suppressed 'If condition is always false' error pointed at the dead include_node_paths_only branch in get_block_nodes() pseudo selector handling, which this PR removes. With the code gone the unmatched baseline entry itself fails analysis because reportUnmatchedIgnoredErrors is enabled.
ramonjd
left a comment
There was a problem hiding this comment.
Tested this manually and also compared the GB code. LGTM
… remove phantom pseudo element style output This commit fixes two bugs in the CSS output of global styles under the following conditions: 1. `get_stylesheet()` used to return nothing for a theme.json elements style only inside a breakpoint. It now returns the correct CSS. 2. An incorrect pseudo style would be output whenever a responsive+pseudo style was set for the element (but no pseudo style itself). That incorrect pseudo style has been suppressed. Developed in: #12918 Reviewed by ramonopoly, isabel_brison. Props talldanwp, ramonopoly, isabel_brison. Fixes #65827. git-svn-id: https://develop.svn.wordpress.org/trunk@63157 602fd350-edb4-49c9-b593-d223f7449a82
… remove phantom pseudo element style output This commit fixes two bugs in the CSS output of global styles under the following conditions: 1. `get_stylesheet()` used to return nothing for a theme.json elements style only inside a breakpoint. It now returns the correct CSS. 2. An incorrect pseudo style would be output whenever a responsive+pseudo style was set for the element (but no pseudo style itself). That incorrect pseudo style has been suppressed. Developed in: WordPress/wordpress-develop#12918 Reviewed by ramonopoly, isabel_brison. Props talldanwp, ramonopoly, isabel_brison. Fixes #65827. Built from https://develop.svn.wordpress.org/trunk@63157 git-svn-id: http://core.svn.wordpress.org/trunk@62356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Backports WordPress/gutenberg#81265 & WordPress/gutenberg#81291
Fixes theme.json output issues for pseudo styles.
Trac ticket: https://core.trac.wordpress.org/ticket/65827
Use of AI Tools
AI assistance: Yes
Tool(s): OpenCode
Model(s): Kimi K3
Used for: Writing Code
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.