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

Cover block with custom content position limits width of inner container #78502

Open
cuemarie opened this issue Jun 21, 2023 · 7 comments
Open
Labels
Blocks Editor blocks, aka Gutenberg blocks, plugins, and extensions Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Feature] Core Blocks Blocks that come with Gutenberg. [Feature Group] Editor Experience Features related to Gutenberg integration on WordPress.com. [Platform] Atomic [Platform] Simple [Pri] Normal [Status] Core Fix Needed A fix within the Core WordPress or Gutenberg project is required to resolve this issue. Triaged To be used when issues have been triaged. [Type] Bug

Comments

@cuemarie
Copy link

cuemarie commented Jun 21, 2023

Core issue: WordPress/gutenberg#50610

Quick summary

If you set up a Cover block with a Row Block set to Space Between Items within it, the row block's space is removed if you set the Cover block to a custom content position, such as Top Center or Bottom Center.

Steps to reproduce

  1. On a Simple or AT test site, create a post and add a Cover block
  2. Inside, place a Row block with at least 2 items in it
  3. Set the Row block to "Space Between Items" justification
  4. Lastly, change the Cover Block > Content position to "Top Center" in the floating toolbar

Setup should look like this:

Cover Block
     > Row (Space items apart)
               > Block 1 (Such as a Site Logo block)
               > Block 2 (Such as a Navigation block)

What you expected to happen

The space between items to remain intact no matter the content placement.

What actually happened

When the Cover Block > Content Position is changed, the blocks within the row block return to right next to each other.

itPxLm.mp4

Atomic

image

Simple

image


I compared the 2 cover blocks in the browser inspector, and it appears this is the problem:

.wp-block-cover-image.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container, .wp-block-cover.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container {
  margin: 0;
  width: auto;
}

When the cover block has a custom content position, the width: auto limits the width of the row block within the cover block.

QaiDXV.mp4

Impact

Some (< 50%)

Available workarounds?

Yes, easy to implement

Platform (Simple and/or Atomic)

Simple, Atomic, Self-hosted

Logs or notes

Workaround

This CSS helps resolve this on my Simple site:

.wp-block-cover.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container {
    width: 100%;
}
@cuemarie cuemarie added [Type] Bug [Pri] Normal Blocks Editor blocks, aka Gutenberg blocks, plugins, and extensions labels Jun 21, 2023
@cuemarie cuemarie added the [Status] Core Fix Needed A fix within the Core WordPress or Gutenberg project is required to resolve this issue. label Jun 21, 2023
@cuemarie
Copy link
Author

📌 ACTIONS

@cuemarie cuemarie added the Triaged To be used when issues have been triaged. label Jun 21, 2023
@cuemarie cuemarie changed the title Cover block with custom content position limits width of items, breaking space between items justification Cover block with custom content position limits width of inner container Jun 21, 2023
@happychait
Copy link

User report: 6452272-zen

@github-actions
Copy link

github-actions bot commented Jun 21, 2023

Support References

This comment is automatically generated. Please do not edit it.

  • 6452272-zen
  • 6455492-zen
  • 6526001-zen
  • 6618125-zen

@cuemarie
Copy link
Author

Provided user with CSS to fix content with here: 6455492-zd-woothemes

@jp-imagines
Copy link

Another report (given CSS workaround) here: 6526001-zd-woothemes

@eduardozulian
Copy link
Member

Another report in 6618125-zen

The CSS workaround helped but just a note to make sure that Inner blocks use content width is off for the Cover block.

@cuemarie
Copy link
Author

Looks like this should be fixed with Gutenberg 16.7: WordPress/gutenberg#54050

@cuemarie cuemarie added [Feature Group] Editor Experience Features related to Gutenberg integration on WordPress.com. [Feature] Core Blocks Blocks that come with Gutenberg. labels Sep 13, 2023
@github-actions github-actions bot added the Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". label Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocks Editor blocks, aka Gutenberg blocks, plugins, and extensions Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Feature] Core Blocks Blocks that come with Gutenberg. [Feature Group] Editor Experience Features related to Gutenberg integration on WordPress.com. [Platform] Atomic [Platform] Simple [Pri] Normal [Status] Core Fix Needed A fix within the Core WordPress or Gutenberg project is required to resolve this issue. Triaged To be used when issues have been triaged. [Type] Bug
Projects
None yet
Development

No branches or pull requests

4 participants