Skip to content

Fix README image distortion by preserving aspect ratio#14261

Draft
fabianbernhart wants to merge 2 commits into
rust-lang:mainfrom
fabianbernhart:fix/readme-image-squishes
Draft

Fix README image distortion by preserving aspect ratio#14261
fabianbernhart wants to merge 2 commits into
rust-lang:mainfrom
fabianbernhart:fix/readme-image-squishes

Conversation

@fabianbernhart

Copy link
Copy Markdown

Adds height: auto to README images to preserve their aspect ratio when constrained by max-width: 100%. This prevents wider-than-container images from being vertically squished and improves README rendering for images with larger dimensions.

Fixes #14133

@fabianbernhart
fabianbernhart marked this pull request as draft July 16, 2026 21:35

@Turbo87 Turbo87 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add an example to the Playwright test that renders a dummy readme? that way we can verify it via visual regression testing (Percy)

View changes since this review

Comment thread svelte/src/lib/components/CrateVersionPage.svelte
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add height: auto to README images

3 participants