Repository navigation
[website] fix home page hero buttons and intro video overflowing on phones - #2341
Merged
Merged
Conversation
…hones The hero buttons sat in a nowrap flex row of "col col--2" children, so on narrow screens "Get Started" was pushed partly off the left edge (about 47px unreachable) and "Learn More" past the right edge. Let the row wrap and drop the grid column classes so each button keeps its natural width. The intro video iframe had a fixed width of 560px, which made the page scroll sideways (up to 256px at 320px). Cap it at the container width and keep a 16:9 aspect ratio.
Contributor
|
thank you! The website has been not properly maintained for a while, so I appreciate it. |
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.
On the home page (https://fbinfer.com/) at phone widths:
col col--2children of adisplay: flexrow that does not wrap, and Docusaurus gives.cola 100% width below 997px.<iframe width="560">is a fixed 560px wide, so the whole page scrolls sideways:scrollWidth - innerWidthis 256px at 320px, 201px at 375px and 162px at 414px.The fix, in
website/src/pages/styles.module.cssandwebsite/src/pages/index.js:.buttonsgetsflex-wrap: wrapand arow-gap, and the two button wrappers drop thecol col--2classes (they keepmargin-horiz--sm). Each button keeps its natural width, the pair is centered, and it wraps to two centered rows when it does not fit..ytVideo iframe { max-width: 100%; height: auto; aspect-ratio: 16 / 9; }, so the video scales to the screen width and keeps the 16:9 shape of the 560x315 embed.Button positions (left edge of the first button / right edge of the second), before and after:
The red marks in the before shots point at the broken part.
At 1280px and wider the buttons already fit, so only a few px of spacing between them changes (the old
colpadding is gone).Test plan
cd website && yarn install --frozen-lockfile && yarn build, thendocusaurus serveand load/.document.documentElement.scrollWidthwith Playwright at 320, 375, 414, 576, 768, 820, 1024, 1280, 1440 before and after (numbers above;scrollWidth == innerWidthat 320, 375, 414, 576, 768, 820, 1280, 1440 after the change). At 1024px the page is 1078px wide both before and after; that comes from the navbar and is not part of this change.npx prettier --check src/pages/styles.module.csspasses.src/pages/index.jsalready failsprettier --checkonmain(trailing comma in theclassnames(...)call), I did not reformat it.(The grey box is the YouTube iframe, which does not load in my offline test browser; I gave it a grey background in the screenshots so its size is visible.)
I found this with renderlint, an open-source CLI I maintain that renders pages in a headless browser and reports layout defects. It flags the cut-off "Get Started" button (content-overflow and text-clipped) before the change and reports neither after. If it would be useful, I'm happy to open a follow-up PR that runs it on the docs in CI; no pressure either way.