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

Add block gap to Post Content block. #54282

Merged
merged 1 commit into from Sep 11, 2023
Merged

Conversation

tellthemachines
Copy link
Contributor

What?

Partially addresses #48902. (I'm not sure how useful adding margin and padding to Post Content might be, though happy to also do so if it's desirable)

We should be able to set a custom spacing in Post Content.

Testing Instructions

Check that block gap can be set on Post Content at the block level as well as in global styles. Gap value should also be correctly reflected in the post editor.

Screenshot 2023-09-08 at 4 07 58 pm

@tellthemachines tellthemachines added [Type] Enhancement A suggestion for improvement. [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Block] Post Content Affects the Post Content Block labels Sep 8, 2023
@tellthemachines tellthemachines self-assigned this Sep 8, 2023
@github-actions
Copy link

github-actions bot commented Sep 8, 2023

Flaky tests detected in 88d932d.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6118324985
📝 Reported issues:

@ramonjd
Copy link
Member

ramonjd commented Sep 11, 2023

This is working very well for me so far. Tested in 2023, 2022 and empty theme on post and page templates. Pages in the site editor appear as they do in the post editor as well.

I tried in various templates and blocks.

Before After
Screenshot 2023-09-11 at 10 03 50 am Screenshot 2023-09-11 at 10 03 28 am
Screenshot 2023-09-11 at 10 03 54 am Screenshot 2023-09-11 at 10 03 19 am

__

Copy link
Contributor

@andrewserong andrewserong left a comment

Choose a reason for hiding this comment

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

This is testing very nicely for me, too. Great that all the prep work done separately means that this feature just works out of the box once it's switched on!

✅ Styles set in global styles are output correctly.
✅ Block-level block spacing within a template correctly overrides styles set in global styles.
✅ Styles are output correctly in post and page editor, and in the site editor, and editing a single page within the site editor.
✅ Block spacing (correctly) only applies to root level blocks within a post content block, and any nested blocks use their own block spacing values as expected.

Examining the styles in dev tools shows the styles are all being overridden correctly:

  • User agent styles are overridden by the layout type's default spacing
  • Layout type's default spacing is overridden by post content block in global styles
  • Global styles spacing is overridden by block-level styles within the particular template
image

LGTM! ✨

@tellthemachines
Copy link
Contributor Author

Thanks for reviewing and testing folks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Content Affects the Post Content Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi Needs User Documentation Needs new user documentation [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants