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

#55702 - Control dimensions (margin and padding) of the list-item block #55874

Merged
merged 1 commit into from
Dec 2, 2023

Conversation

valerogarte
Copy link
Contributor

@valerogarte valerogarte commented Nov 5, 2023

What?

Fixes #55702.

Introduces the ability to adjust the dimensions (margin and padding) of individual list-item blocks within the Gutenberg editor.

Why?

This enhancement addresses the need identified in issue #55702. Previously, users were unable to control the spacing around list items, leading to limited styling options and potential layout inconsistencies. By allowing for margin and padding adjustments, this change provides greater flexibility and precision in design.

How?

Support for dimension controls has been added to the block.json file of the list-item block. This includes the necessary backend changes to enable these features within the block editor's interface.

Testing Instructions

  1. Open a post or page.
  2. Insert a "List" block into the content.
  3. Add several items to the list to test different spacing scenarios
  4. Select the list block and expand the "Dimensions" panel in the block settings sidebar.
  5. Adjust the margin and padding values and observe the changes in real-time in the editor.

Testing Instructions for Keyboard

  1. Click on a list element to activate it.
  2. Press Tab to cycle through the block's controls until you reach the "Dimensions" panel.
  3. Use the Enter key to expand the "Dimensions" options if necessary.
  4. With the dimensions panel expanded, use the arrow keys to adjust the margin and padding values.
  5. Press Enter to apply the changes and Tab to continue navigating to the next control

Screenshots or screencast

image

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Nov 5, 2023
Copy link

github-actions bot commented Nov 5, 2023

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @valerogarte! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@valerogarte valerogarte marked this pull request as draft November 5, 2023 19:58
@valerogarte valerogarte changed the title #55702 - Control dimensions (margin and padding) of the list-item block Nov 5, 2023
@valerogarte valerogarte marked this pull request as ready for review November 5, 2023 20:26
@cbravobernal cbravobernal added the [Type] Enhancement A suggestion for improvement. label Nov 5, 2023
@valerogarte valerogarte changed the title #55702 - Control dimensions (margin and padding) of the list-item block [Type] Enhancement Nov 5, 2023
@fabiankaegy fabiankaegy added the [Block] List Affects the List Block label Nov 6, 2023
@ramonjd
Copy link
Member

ramonjd commented Dec 1, 2023

Thanks for the PR!

Screenshot 2023-12-01 at 3 06 03 pm

This looks like a nice addition. LGTM and works as expected.

Would like a sanity check from @jasmussen before ✅ and 🚢

@jasmussen
Copy link
Contributor

Seems fine to me (and thank you for the PR!). Is there a global styles counterpart? I.e. can I set and forget some dimensions there, and have them apply across all list items? Did not have time to fully test this PR this morning, sorry. CC: @WordPress/gutenberg-design for a broader check.

@jameskoster
Copy link
Contributor

I reckon most blocks should support margin/padding. So yes please!

@richtabor
Copy link
Member

Is there a global styles counterpart?

Yes, it works fine in Global Styles as well.

CleanShot 2023-12-01 at 20 46 07

@richtabor richtabor self-requested a review December 2, 2023 01:46
Copy link
Member

@richtabor richtabor 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 contributing! LGTM.

@richtabor richtabor enabled auto-merge (squash) December 2, 2023 01:48
@richtabor richtabor merged commit 6833642 into WordPress:trunk Dec 2, 2023
49 checks passed
@github-actions github-actions bot added this to the Gutenberg 17.3 milestone Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] List Affects the List Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Enhancement A suggestion for improvement.
8 participants