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 block: Switch to blockGap #49406

Open
corentin-gautier opened this issue Mar 28, 2023 · 7 comments
Open

Media & text block: Switch to blockGap #49406

corentin-gautier opened this issue Mar 28, 2023 · 7 comments
Labels
[Block] Media & Text Affects the Media & Text Block [Type] Enhancement A suggestion for improvement.

Comments

@corentin-gautier
Copy link
Contributor

What problem does this address?

The Media & Text block doesn't use the block gap system but uses padding on the content instead, which is somewhat arbitrary and doesn't provide a way to control the spacing between the image and the text.

Screenshot 2023-03-28 at 17 23 12

What is your proposed solution?

Switch to using blockGap

@kathrynwp kathrynwp added [Type] Enhancement A suggestion for improvement. [Block] Media & Text Affects the Media & Text Block Needs Technical Feedback Needs testing from a developer perspective. labels Mar 28, 2023
@talldan
Copy link
Contributor

talldan commented Apr 11, 2023

The padding to the left and right of the content? The image and the content area aren't blocks. This means it may be difficult to configure it to use block gap without some dramatic refactoring of the block to use a more nested structure.

If layout and block gap were added to Media and Text, then I would expect it to apply vertically between any blocks in the content area.

@talldan talldan removed the Needs Technical Feedback Needs testing from a developer perspective. label Apr 11, 2023
@andrewserong
Copy link
Contributor

This means it may be difficult to configure it to use block gap without some dramatic refactoring of the block to use a more nested structure.

I agree, and I'm not sure how valuable that effort would be. For patterns that involve an image next to another set of arbitrary block content, where the user can control the spacing between those two areas, I think the Row block probably fits that need quite well, and there's also the Columns block, or the experimental Grid block, too. So, from my perspective, I think the benefit for adding Layout to Media & Text would primarily be about controlling the vertical spacing within the content area as you mention:

If layout and block gap were added to Media and Text, then I would expect it to apply vertically between any blocks in the content area.

Yes, I think that's how layout would work here because the layout support controls the behaviour of the inner blocks wrapper.

@corentin-gautier
Copy link
Contributor Author

corentin-gautier commented Apr 11, 2023

Regardless of the technical solution, the end user probably expect to be able to control both the spacing between the image and the content (horizontal) and the spacing between the blocks in the content (vertical).

Not having control over the horizontal spacing means the end user cannot match the spacings of a media & text with a columns block for example.

Screenshot 2023-04-11 at 10 42 51

A "simple" solution to this would be to be able to control both horizontal and vertical spacing (the same way other controls can be "unlocked" to allow individual control over top,left,bottom and right)

Screenshot 2023-04-11 at 10 45 19

@richtabor
Copy link
Member

Perhaps an easier solution would be to leverage the core/group block as a parent block within the Media & Text block (for newly inserted instances)—instead of bending the margin/padding/blockGap controls to work out abnormally with this block.

CleanShot.2023-04-12.at.11.07.08.mp4

@corentin-gautier
Copy link
Contributor Author

@richtabor I don't think having vertical & horizontal controls would be abnormal, the gap property actually supports separate vertical and horizontal values : https://developer.mozilla.org/en-US/docs/Web/CSS/gap. So even if it's not the solution for the media & text block, having separate controls in "Block spacing" could be interesting anyway

@richtabor
Copy link
Member

I meant that the Group block has all of these controls already.

It may be simpler to implement that as a wrapper for the content, instead of building the same controls ad hoc.

@corentin-gautier
Copy link
Contributor Author

Regardless of the technical solution, the end user probably expect to be able to control both the spacing between the image and the content (horizontal) and the spacing between the blocks in the content (vertical).

Not having control over the horizontal spacing means the end user cannot match the spacings of a media & text with a columns block for example.

I still think this is an issue making this block kind of useless (you have to use the row or columns blocks instead because you can't control the spacing with media & text)

justintadlock added a commit to x3p0-dev/x3p0-ideas that referenced this issue May 12, 2024
Adds a default block gap to the Media & Text block and removes WordPress' arbitrary, hardcoded padding from the content area, which breaks both vertical and horizontal rhythm.

See: WordPress/gutenberg#49406
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 [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

5 participants