Skip to content

[website] fix home page hero buttons and intro video overflowing on phones - #2341

Merged
dulmarod merged 1 commit into
meta:mainfrom
ngocanhnckh:fix/hero-buttons-mobile
Dec 1, 2026
Merged

dulmarod merged 1 commit into
meta:mainfrom
ngocanhnckh:fix/hero-buttons-mobile

Conversation

@ngocanhnckh

Copy link
Copy Markdown
Contributor

On the home page (https://fbinfer.com/) at phone widths:

  • The hero "Get Started" button sits about 47px off the left edge, so its left part cannot be reached or scrolled to. "Learn More" runs past the right edge. This is measured at 320, 375, 414 and 768px (the button's left edge is -47px each time). The two buttons are col col--2 children of a display: flex row that does not wrap, and Docusaurus gives .col a 100% width below 997px.
  • The intro video <iframe width="560"> is a fixed 560px wide, so the whole page scrolls sideways: scrollWidth - innerWidth is 256px at 320px, 201px at 375px and 162px at 414px.

The fix, in website/src/pages/styles.module.css and website/src/pages/index.js:

  • .buttons gets flex-wrap: wrap and a row-gap, and the two button wrappers drop the col col--2 classes (they keep margin-horiz--sm). Each button keeps its natural width, the pair is centered, and it wraps to two centered rows when it does not fit.
  • New .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.

Width Before After
320 -47.3 / 367.4, page 576px wide 72.6 / 247.4, page 320px wide
375 -47.3 / 422.4, page 576px wide 100.1 / 274.9, page 375px wide
414 -47.3 / 461.4, page 576px wide 119.6 / 294.4, page 414px wide
768 -47.3 / 815.4 201.3 / 566.7
1280 463.3 / 838.8 (fits, centered at 651) 457.3 / 822.7 (centered at 640)

At 1280px and wider the buttons already fit, so only a few px of spacing between them changes (the old col padding is gone).

Test plan

  • cd website && yarn install --frozen-lockfile && yarn build, then docusaurus serve and load /.
  • Measured the button rects and document.documentElement.scrollWidth with Playwright at 320, 375, 414, 576, 768, 820, 1024, 1280, 1440 before and after (numbers above; scrollWidth == innerWidth at 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.
  • Looked at light and dark theme.
  • npx prettier --check src/pages/styles.module.css passes. src/pages/index.js already fails prettier --check on main (trailing comma in the classnames(...) call), I did not reformat it.
Width Before After
320px, light Before, 320px light After, 320px light
375px, light Before, 375px light After, 375px light
414px, dark Before, 414px dark After, 414px dark
768px, light Before, 768px light After, 768px light

(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.

…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.
@meta-cla meta-cla Bot added the CLA Signed label Nov 30, 2026
@dulmarod

dulmarod commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

thank you! The website has been not properly maintained for a while, so I appreciate it.

@dulmarod
dulmarod merged commit 60a60c5 into meta:main Dec 1, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants