Skip to content

Media & Text: add "gap" options #67208

Closed as duplicate
Closed as duplicate

Description

@sgomes

What problem does this address?

The existing Media & Text controls for padding and margin apply to the entire block:

Image

This makes it difficult to use the media block for use-cases where more control is needed within the block, such as:

  • controlling the space between the media and the text
    Image
  • having the image span the full height of the block, while ensuring the text has a custom amount of padding.
    Image

What is your proposed solution?

The introduction of a gap option for the text could help. This would be implemented as a configurable 4-way padding or margin around the text, allowing the user to control:

  • how much space there is between the media and the text
  • how much space there is between the text and the other horizontal edge
  • how much space there is between the text and the top/bottom of the block

An alternative would be having a separate padding controls for the media and the text:

Image

Activity

  1. Mayank-Tripathi32 commented on Nov 21, 2024

    @Mayank-Tripathi32
    Member

    Hi @sgomes,

    Thank you for raising this issue.
    I believe many of the suggested actions can be achieved by simply wrapping the paragraph in a Group block.

    Image

  2. sgomes commented on Nov 22, 2024

    @sgomes
    ContributorAuthor

    Thank you, @Mayank-Tripathi32!

    Yes, that's correct, and it's a great workaround if you need this now 👍 Other workarounds involve composing a few layout blocks to achieve a similar effect, without using Media & Text at all.

    However, it could become cumbersome and somewhat error-prone to use this approach across many instances of Media & Text. So I see this as more of a convenience feature to enable a few extra options on Media & Block directly, and to have them easily applied to all your Media & Text blocks via something like global styles.

  3. t-hamano commented on Nov 22, 2024

    @t-hamano
    Contributor

    At the very least, it seems reasonable to be able to control the gap between media and content. This is also discussed in #49406.

  4. Mayank-Tripathi32 commented on Nov 22, 2024

    @Mayank-Tripathi32
    Member

    Hi, I’m working on a PR to add gap control for media and content component. I believe the rest can be achieved using the group block.

  5. Mamaduka commented on Dec 11, 2024

    @Mamaduka
    Member

    I think this is similar to #28556.

  6. t-hamano commented on Jun 2, 2025

    @t-hamano
    Contributor

    We first need to decide where to apply the gap, because multiple blockGap support is not available:

    • Between the media and the content (Suggested in this issue)
    • Between blocks within the content (Suggested in #70264)

    Additionally, whichever approach is adopted will require discussion of how it will affect existing blocks and how to maintain backward compatibility.

  7. benoitchantre commented on Jun 2, 2025

    @benoitchantre
    Contributor

    How can we manage the vertical spacing between the text elements?

    For now, there's an unwanted margin (from the browser styles) and no block gap used for vertical spacing between the text elements (see #70264).

  8. Mayank-Tripathi32 commented on Jun 3, 2025

    @Mayank-Tripathi32
    Member

    I'd like to discuss how we should approach adding blockGap support. Currently, I'm extracting it from attributes and applying it manually in the editor. However, it would be great if we could extend the functionality to detect and apply it automatically.

  9. karmatosed commented on Jul 11, 2025

    @karmatosed
    Member

    This feels like it needs feedback on the implementation not 'design' made specifically so switching out the labels.

  10. jasmussen commented on Aug 24, 2026

    @jasmussen
    Contributor

    The issue is valid, let's get a dev on it. However let's do that as part of #28556 which touches the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions