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

[List Block] - Add support for block gap #69310

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

Mayank-Tripathi32
Copy link
Contributor

@Mayank-Tripathi32 Mayank-Tripathi32 commented Feb 25, 2025

Resolves #69308

What?

This PR implements the blockGap support for the core/list block, allowing control over spacing between list items.

Why?

The core/list block currently lacks blockGap and layout support, making it difficult to control the spacing between core/list-item blocks. Since core/list-item is a separate block, the gap should be adjustable through blockGap, ensuring better design flexibility and consistency with other blocks that support spacing control.

How?

  • Added supports: { spacing: { blockGap: true } } to the core/list block.
  • Added Layout support and disabled editing.
  • Ensured that the blockGap value is applied correctly in the block's styling.

Testing Instructions

  1. Open the Block Editor (Gutenberg).
  2. Insert a List block (core/list).
  3. Add multiple List Item (core/list-item) blocks inside it.
  4. Adjust the blockGap value using the spacing controls in the sidebar.
  5. Verify that the spacing between list items updates correctly both in the editor and frontend.
  6. Save and refresh to ensure the setting persists.

Screencast

Screen.Recording.2025-02-26.at.8.11.53.PM.mov

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Block] List Affects the List Block labels Feb 26, 2025
@Mayank-Tripathi32 Mayank-Tripathi32 marked this pull request as ready for review February 26, 2025 14:48
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @EldarAgalarov.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: EldarAgalarov.

Co-authored-by: Mayank-Tripathi32 <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

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 [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

core/list: Missing blockGap property
2 participants