Skip to content

Media & Text: text content should use layout flow spacing #70264

Closed as duplicate

Description

@benoitchantre

Description

The first element inside the content of this block will keep its top margin if it has one. For example, headings or paragraphs have a top margin inherited from the browser styles.

I expect the inner content of this block to be spaced like other blocks.

I suggest to add the following classes to the text content part is-layout-flow and wp-block-media-text__content-is-layout-flow.

Step-by-step reproduction instructions

  1. Add a Media Text block
  2. Add some content
  3. See that the first item keeps it top margin (heading, paragraph)

Screenshots, screen recording, code snippet

Image

Environment info

  • WordPress 8.1
  • Firefox

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Activity

  1. Rishit30G commented on May 30, 2025

    @Rishit30G
    Contributor

    Thanks for sharing the issue,

    I have added the is-layout-flow class, please let me know if this is the expected behaviour for the text content

    Screen.Recording.2025-05-30.at.8.30.23.AM.mov
  2. benoitchantre commented on May 30, 2025

    @benoitchantre
    ContributorAuthor

    Yes, this is the expected behavior.

    Also, I you split your text in two, you will see that the spacing between the two elements uses the expected value.

    Thank you for your test.

  3. Rishit30G commented on May 30, 2025

    @Rishit30G
    Contributor

    Noted, I'll raise a PR soon for this 📝
    Thanks

  4. added
    [Feature] LayoutLayout block support, its UI controls, and style output.
    and removed
    [Type] BugAn existing feature does not function as intended
    on May 30, 2025
  5. t-hamano commented on Jun 2, 2025

    @t-hamano
    Contributor

    Thanks for the report.

    I suggest to add the following classes to the text content part is-layout-flow and wp-block-media-text__content-is-layout-flow.

    These classes should be applied via the blockGap support, but there is another suggestion to add the gap between the image and the content.

    Let's discuss this issue in #67208.

  6. benoitchantre commented on Jun 2, 2025

    @benoitchantre
    ContributorAuthor

    Thank you

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

Metadata

Metadata

Assignees

Labels

[Block] Media & TextAffects the Media & Text Block[Feature] LayoutLayout block support, its UI controls, and style output.[Status] In ProgressTracking issues with work in progress[Type] EnhancementA suggestion for improvement.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions