Repository navigation
Conversation
Astro assumes images can fill the viewport, but Starlight caps the content column at 47rem, so browsers picked oversized srcset candidates. Set sizes to the real max display width.
jacobgkau
force-pushed
the
fix/image-sizes-attribute
branch
from
November 5, 2026 19:38
1d96330 to
3e0b698
Compare
jacobgkau
reviewed
Nov 5, 2026
jacobgkau
left a comment
Member
There was a problem hiding this comment.
This is (obviously) lowering the quality of images displayed on the page. Since we're capping the resolution at the displayed size, the PR description makes it sound like we're simply capping the quality level at what it should be at the displayed size, but the quality difference is perceptible at 100% for some images. Additionally, the quality difference becomes more apparent as soon as you start zooming into the webpage.
So, a couple of questions:
- Could we calculate twice the size of the max width instead of only the max width? This would provide wiggle room for zooming in (which is very casual to do these days with pinch-to-zoom, and is also an accessibility consideration). It would still be a decrease in size from the current miscalculation, so it would still be a bandwidth reduction for us.
- If you're not on-board with that approach, what is the AVIF quality level (% or CRF) these resized images are being rendered at, and do we have any control over it? For reference, I use 60% quality for the full-size AVIF images, but in photo/video rendering, it's common to need to increase the quality level as the resolution is decreased (because as resolution decreases, you have less extraneous detail that you could drop).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Astro assumes images can fill the viewport, but Starlight caps the content column at 47rem, so browsers picked oversized srcset candidates. Set sizes to the real max display width.