Skip to content

Conversation

@wenkokke
Copy link

When an image has an explicit width and height, the max-width specification on images rescales the width down, but leaves the explicit height.

This does not only happen when the user sets the width and height explicitly, but may also be done by JavaScript frameworks such as Astro to optimize for the cumulative layout shift metric, see this section in the Astro documentation.

This PR fixes this issue by setting height: auto for images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant