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: add "gap" options #67208

Open
sgomes opened this issue Nov 21, 2024 · 4 comments · May be fixed by #67247
Open

Media & Text: add "gap" options #67208

sgomes opened this issue Nov 21, 2024 · 4 comments · May be fixed by #67247
Assignees
Labels
[Block] Media & Text Affects the Media & Text Block Needs Design Needs design efforts. [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@sgomes
Copy link
Contributor

sgomes commented Nov 21, 2024

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

@sgomes sgomes added [Block] Media & Text Affects the Media & Text Block [Type] Enhancement A suggestion for improvement. Needs Design Needs design efforts. labels Nov 21, 2024
@Mayank-Tripathi32
Copy link

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

@sgomes
Copy link
Contributor Author

sgomes commented Nov 22, 2024

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.

@t-hamano
Copy link
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.

@Mayank-Tripathi32
Copy link

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.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Nov 22, 2024
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 Needs Design Needs design efforts. [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants