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

Media & Text: Add spacing block supports #43456

Merged

Conversation

ndiego
Copy link
Member

@ndiego ndiego commented Aug 21, 2022

Related:

What?

Add padding and margin support to the Media & Text block.

Why?

To create consistency across blocks.

How?

Added the relevant block supports in block.json

Testing Instructions

  1. Insert a new Media & Text block.
  2. Confirm that the dimensions control panel is there and there are no defaults.
  3. Add padding and margin.

Screenshots or screencast

media-text-spacing

@ndiego ndiego self-assigned this Aug 21, 2022
@ndiego ndiego added [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Type] Enhancement A suggestion for improvement. [Block] Media & Text Affects the Media & Text Block labels Aug 21, 2022
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.

Apologies for leaving basically the same feedback on each of these PRs @ndiego, but thanks so much again for digging into all these opt-ins!

It looks like this block will also need the box-sizing: border-box rule in order for the padding to line up with adjacent blocks like Group.

image

Here's the comparable rule from the Cover block that we can use:

// This block has customizable padding, border-box makes that more predictable.
box-sizing: border-box;

Copy link
Contributor

@aaronrobertshaw aaronrobertshaw left a comment

Choose a reason for hiding this comment

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

Thanks for putting this PR together @ndiego 👍

I'd like to echo Andrew's suggestions around box-sizing. Also, to help with tracking our progress towards improving consistency in our design tool availability I've added this to the current tracking table.

@ndiego
Copy link
Member Author

ndiego commented Aug 22, 2022

Thanks! I'll get box-sizing taken care of today.

@ndiego
Copy link
Member Author

ndiego commented Aug 22, 2022

@aaronrobertshaw box-sizing has been added and tested. All looks good on my end.

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.

Thanks for updating this one, too, @ndiego!

✅ Padding is working as expected in the post editor
✅ Padding is working as expected in the site editor and set in global styles

image

LGTM! ✨

@ndiego
Copy link
Member Author

ndiego commented Aug 23, 2022

Thanks for reviewing @andrewserong. These Admin e2e tests keep timing out, any ideas?

@andrewserong
Copy link
Contributor

@ndiego I think it's just an unrelated flaky e2e test. Looks like it's passing now, so I'll merge this in!

@andrewserong andrewserong merged commit a7f1c92 into WordPress:trunk Aug 24, 2022
@github-actions github-actions bot added this to the Gutenberg 14.0 milestone Aug 24, 2022
@femkreations femkreations added the Needs User Documentation Needs new user documentation label Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Media & Text Affects the Media & Text 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.
4 participants