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

Accurate sizes: Image block with center alignment gets wrong sizes #1725

Closed
mukeshpanchal27 opened this issue Dec 9, 2024 · 1 comment
Closed
Assignees
Labels
[Plugin] Enhanced Responsive Images Issues for the Enhanced Responsive Images plugin (formerly Auto Sizes) [Type] Bug An existing feature is broken

Comments

@mukeshpanchal27
Copy link
Member

Summary

When the Image block is set to center alignment, it is constrained by its intrinsic width. However, it should instead be constrained by the contentSize as specified in the CSS.

When image block sets with the center alignment it constrained by contentSize but per current implementation it constrained by image width that needs to be correct.

Core CSS that apply when center alignment sets:

.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
    max-width: var(--wp--style--global--content-size);
    margin-left: auto !important;
    margin-right: auto !important;
}

Steps to Reproduce:

  1. Insert an Image block into a post or page.
  2. Set the image alignment to center.
  3. Observe that the image width is not properly constrained by the contentSize defined in the theme.

Image

@mukeshpanchal27 mukeshpanchal27 added [Plugin] Enhanced Responsive Images Issues for the Enhanced Responsive Images plugin (formerly Auto Sizes) [Type] Bug An existing feature is broken labels Dec 9, 2024
@github-project-automation github-project-automation bot moved this to Not Started/Backlog 📆 in WP Performance 2024 Dec 9, 2024
@mukeshpanchal27 mukeshpanchal27 self-assigned this Dec 9, 2024
@mukeshpanchal27 mukeshpanchal27 moved this from Not Started/Backlog 📆 to To Do 🔧 in WP Performance 2024 Dec 9, 2024
@joemcgill
Copy link
Member

This has been address as part of #1701.

@github-project-automation github-project-automation bot moved this from To Do 🔧 to Done 😃 in WP Performance 2024 Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Enhanced Responsive Images Issues for the Enhanced Responsive Images plugin (formerly Auto Sizes) [Type] Bug An existing feature is broken
Projects
Status: Done 😃
Development

No branches or pull requests

2 participants