-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
LinkControl: Prevent horizontally long preview image from being stretched vertically #55156
Conversation
Size Change: +26 B (0%) Total Size: 1.65 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Flaky tests detected in 1941031. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6455017955
|
Thanks for the review, @ntsekouras! |
What?
This PR fixes an issue where if the image ratio is long horizontally relative to the LinkControl's preview area ratio, it will be stretched vertically.
Example: https://make.wordpress.org/chat/
Why?
height:100%
stretches the image to fill the container, which has a height of 140px.This is fine for regular images, but if the image is long relative to the container's aspect ratio, it will be unintentionally stretched vertically.
How?
I used object-fit:contain to fit the image within the container area while maintaining the image's aspect ratio.
Testing Instructions
https://make.wordpress.org/chat/
.