-
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
Remove alignments from the root level of the site editor #30079
Conversation
Size Change: +22 B (0%) Total Size: 1.41 MB
ℹ️ View Unchanged
|
Tested with the updated emptytheme. I believe the PR is working as intended, but there is no way to set blocks to be truly full width because of a 10px padding on .editor-styles-wrapper and a 8px margin on the body on the front (browser default) which are not overridden. |
Seems good to follow up on separately 👍 👍 |
This is a good point and one I'm not entirely sure how to fix. There are actually two things to fix here:
The second thing to fix is more related to the editor UI. That padding can be useful some times to avoid things touching the "borders" of the canvas in the editor, so I wonder If instead of relying on that padding for that, we should introduce a grayed area/canvas of 10px around the editor canvas that is always there (kind of like the one in the tablet/mobile previews). I do think it's separate from this issue though even if surfaced here by the fact that we're loading the editor styles from Gutenberg. |
I think UI-wise we are in a better place to handle interface controls that go all the way to the edge than we used to. But I do agree, the experience is better, and dare I say less "broken looking" than if the padding was zero. So it does seem like the padding should be handled by theme.json, but perhaps also come with a good default. And we probably also need something for non-block-themes, just like the system font change. |
wideControlsEnabled: settings.alignWide, | ||
}; | ||
}, [] ); | ||
const layout = useLayout(); |
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.
I think we can do a destructuring here
const { type, alignments: availableAlignments = DEFAULT_CONTROLS } = useLayout();
packages/block-editor/src/components/block-alignment-control/use-available-alignments.js
Show resolved
Hide resolved
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.
I'll let someone else weigh in on the code, but in general, this change makes a lot of sense. Thanks Riad!
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.
In my testing, this worked well. Let's try it.
I did notice the editor styles wrapper 10px that @carolinan mentions in the nav editor. For now I can override it. Similarly the nav block’s wrapping That’s something that might affect other blocks. |
This is fixed in #29975: https://github.com/WordPress/gutenberg/pull/29975/files#diff-67a82afbd315a0b5cdb7ef57ee1217941097ae7b6668be90a896c109473c253aR9. |
I believe this PR may have had the unintended side effect of making it impossible to use Full Width Blocks at the root level in Template Parts: We have a hybrid theme, designed for the Block Editor but not FSE, that leverages template parts. Some of these template parts definitely want to be full-width. |
This PR does two things: