-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Site Editor: Fix the Root Padding styles #61906
Conversation
@@ -1224,10 +1232,6 @@ export function useGlobalStylesOutputWithConfig( mergedConfig = {} ) { | |||
return !! getSettings().disableLayoutStyles; | |||
} ); | |||
|
|||
const blockContext = useContext( BlockContext ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the bug, who says that useGlobalStylesOutput need to be run within "BlockContext" and why?
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Works.
Size Change: -24 B (0%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
Flaky tests detected in d43c2ef. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9209208799
|
Co-authored-by: youknowriad <[email protected]> Co-authored-by: jasmussen <[email protected]>
Co-authored-by: youknowriad <[email protected]> Co-authored-by: jasmussen <[email protected]>
Fix regression introduced in #61860
What?
The GlobalStyles styles generation hook had a hidden dependency towards the "BlockContext". The hook required that it would be applied within that context to generate the right styles for templates. That is a weird dependency. So when we moved the component to generate the styles, the context was not wrapping it anymore, so things started to break.
This PR solves that by removing this dependency in favor of an explicit argument.
Testing Instructions
1- Open a template or a page in the site editor: root padding should be applied
2- Open a template part or a pattern: root padding should not be applied.