Repository navigation
Size the README animations in pixels so they fill the width on phones - #504
Merged
Merged
Conversation
The widths were percentages of the README column, so on a phone each GIF got a fraction of ~360 px (the Learner1D one ended up ~150 px wide). With pixel widths of the same 160 px height, the three still sit in one row on desktop (815 of GitHub's 838 px), while on phones GitHub's `max-width: 100%` lets each one wrap to its own row at up to the full column width.
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.
Summary
The README animations had percentage widths (43% / 36% / 19%), so on a phone each one got a fraction of a ~330 px column: the Learner1D GIF rendered at 139 × 63 px and the LearnerND one at 62 × 62 px.
They now have pixel widths with the same 160 px height (356 / 299 / 160 px). On desktop they still sit in one row, since GitHub's README column is 838 px. On narrower screens GitHub's
img { max-width: 100% }lets each one wrap to its own row at up to the full column width.GitHub strips
style, so the media-query approach the docs home page uses (docs/_static/extra.css) is not available here. I also tried<picture><source media=... srcset="... 2.25x">to change the size per breakpoint, but GitHub's camo proxy folds the2.25xdescriptor into the proxied URL, which breaks the image.Image sizes measured with Playwright on the rendered repository page,
mainversus this branch:maindocs/index.mdhas its own copy of the markup and CSS for phones, so the docs site is unchanged.Test plan
main