-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Post editor: Allow root padding setting to affect padding of post title #49460
Post editor: Allow root padding setting to affect padding of post title #49460
Conversation
Size Change: +78 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
Flaky tests detected in 1f67ea0. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4560442728
|
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.
Thanks for fixing this! Looks like it was a regression caused by #48663.
What?
While testing #47858, I noticed that the post title in the post editor doesn't currently receive padding rules for themes using
useRootPaddingAwareAlignments
(e.g. TwentyTwentyThree).The issue is noticeable in a narrower viewport, for example, when the list view is open. You'll only really notice it when the editor canvas is narrower than the site's content size.
Why?
This is because when
useRootPaddingAwareAlignments
is in use, we expect thehas-global-padding
class to be applied to containers where the padding is in use, in order for the padding to be applied as expected (and not to full-width root blocks). For the post title wrapper, this means we need to explicitly output that classname, otherwise it displays as if it were full-width to the edge of the screen (once the viewport is narrower than the content size).How?
has-global-padding
class whenuseRootPaddingAwareAlignments
is in use.Testing Instructions
trunk
, running TT3, verify the before image below — in narrower viewports with the list view open, the post title wrapper touches the edge of the editor canvas.theme.json
file and switchsettings.useRootPaddingAwareAlignments
tofalse
, then reload the page. The padding should still be correct, as the padding will now be set further up on the body element viaeditor-styles-wrapper
.Screenshots or screencast