Fix Post Featured Image overflow in Group flex layouts with aspect ratio#77652
Fix Post Featured Image overflow in Group flex layouts with aspect ratio#77652Mustafabharmal wants to merge 1 commit intoWordPress:trunkfrom
Conversation
Co-authored-by: Copilot <copilot@github.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @brokmech, @pshemek. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
t-hamano
left a comment
There was a problem hiding this comment.
Thanks for working on this! Let's explore the optimal approach from a broader perspective, rather than making specific modifications within a particular block. See #67430 (comment)
What?
Closes #67430
Fixes an overflow issue where Post Featured Image can exceed its container width in Group flex layouts (Stack/Row) when an aspect ratio is set (for example 4/3 or 16/9).
Why?
The issue has been reproducible across multiple environments and browsers when Query Loop items include featured images with mixed source proportions and a wide aspect ratio. This breaks expected layout behavior in Stack/Row contexts.
How?
Adds a minimal, scoped style rule for Post Featured Image only when it is inside a Group flex layout:
max-width: 100%in.wp-block-group.is-layout-flexcontextThis keeps the fix targeted to the problematic layout context and avoids broader style impact.
Testing Instructions
4/3or16/9.Screenshots or screencast
Before: Featured image overflows in Stack/Row with wide aspect ratio
Before.css.fix.featured.image.mov
After: Featured image remains constrained within container
After.css.fix.featured.image.mov