Skip to content
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

VisualEditor: Always output has-global-padding classname when in post only mode #66626

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/editor/src/components/visual-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,13 @@ function VisualEditor( {
renderingMode !== 'post-only' ||
isDesignPostType
? 'wp-site-blocks'
: `${ blockListLayoutClass } wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules.
: `${ blockListLayoutClass } wp-block-post-content`, // Ensure root level blocks receive default/flow blockGap styling rules.
{
'has-global-padding':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm, this is to make things prettier when writing posts (without template preview?)

Things are working as expected for me.

I can see that has-global-padding is on the root container in the editor, even if I switched "Inner blocks use content width" off for the content block:

Before After
Screenshot 2024-10-31 at 4 08 15 pm Screenshot 2024-10-31 at 4 09 17 pm

I tested this also on TT4 and could see the same thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this for a spin!

Just to confirm, this is to make things prettier when writing posts (without template preview?)

Yep, that's the goal! Feedback from @jasmussen has been that we should never (or possibly almost never) have edge-to-edge content in the abstracted editor (without template preview), so this PR helps address a particular case where there was missing padding.

Ever since the editors were unified and folks can toggle template preview, there's a little less pressure for the editor to try to be WYSIWYG, as that's what template preview is for. So, we can afford to be a little less WYSIWYG to optimise for the writing experience / things looking neat.

But let's see what the designers think 🙂

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great thanks, LGTM in that case

renderingMode === 'post-only' &&
! isDesignPostType &&
hasRootPaddingAwareAlignments,
}
) }
layout={ blockListLayout }
dropZoneElement={
Expand Down
Loading