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

Modern Image Formats picture support breaks gallery block cropping #1300

Closed
joemcgill opened this issue Jun 12, 2024 · 3 comments · Fixed by #1307
Closed

Modern Image Formats picture support breaks gallery block cropping #1300

joemcgill opened this issue Jun 12, 2024 · 3 comments · Fixed by #1307
Assignees
Labels
[Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) [Type] Bug An existing feature is broken

Comments

@joemcgill
Copy link
Member

Bug Description

When using the new Modern Image Formats picture element support on my personal site, I noticed that the markup conflicted with the style for an image gallery created using the wp:gallery block when the "Crop images to fit" setting was enabled for the block.

I've left the feature enabled on my site for now so the behavior can be observed.

Steps to reproduce

  1. Activate the Modern Image Formats plugin and enable picture support from the Media Settings screen.
  2. Create an image gallery using the core gallery block that includes images with different aspect ratios
  3. Turn on the "Crop images to fit" setting on the Gallery block settings panel (screenshot below)
  4. Preview the page in the front end

Screenshots

Screenshot of the settings panel

image

Before using picture

image

With picture support enabled

image
@joemcgill joemcgill added [Type] Bug An existing feature is broken [Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) labels Jun 12, 2024
@adamsilverstein
Copy link
Member

@joemcgill thanks for the bug report (and ouch that first photo!). This is likely due to a CSS selector that isn't applying correctly. We will either need to change the specificity to make it work, or add an additional selector for the picture element version.

@joemcgill
Copy link
Member Author

No problem, and sorry for my face. I've recovered! I assumed there was a CSS issue but haven't dug into it. Wanted to report it while it was top of mind.

@devansh016
Copy link
Contributor

devansh016 commented Jun 14, 2024

Would like to work on this issue. Can you assign me this?

Adding the following css to picture tag should solve this issue.

style="display: contents;"

@joemcgill @adamsilverstein

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) [Type] Bug An existing feature is broken
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants