Repository navigation
docs: fix the site's layout on phones and tablets - #54
Merged
fas89 merged 1 commit intoNov 15, 2026
Merged
Conversation
The phone menu was see-through. `.vp-sidebar` is transparent so it blends with the page beside it on desktop, but below the mobile breakpoint the sidebar is the menu drawer, laid over the page. The home page showed through it, and the drawer's borders ran across the page as stray lines. The drawer now has the page background. Pages scrolled sideways. The table restyle set `display: table; width: 100%; overflow: hidden`, which turned off the theme's `display: block; overflow-x: auto`. At 375px, 8 of the 19 pages checked were wider than the screen, the schema cheatsheet at 870px, and the cheatsheet overflowed on tablets too. Tables keep the theme's scrolling again, so a wide table scrolls inside itself. A table that fits is now as wide as its content rather than the full column, which is the theme's default. The hero's grid texture bled 6px past the home page on phones. `.vp-home` now clips it with `overflow-x: clip`. GitHub was in the navbar twice: once from the nav list and once from `repo:`. The nav entry is gone. Four links showed two arrows, a typed "↗" and the theme's external-link icon; the typed ones are gone. From 720px to about 1120px wide, the nine navbar links pushed the search box and the color-mode toggle off screen, on landscape phones and iPads. `$MQMobile` is now 1149px in palette.scss, so below 1150px the links move into the menu drawer. Tablets get the drawer and full-width content instead of a sidebar that is always on screen.
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.
What was wrong
On phones and tablets the site had five layout problems:
.vp-sidebaris transparent so it blends with the page on desktop, but on phones the sidebar is the menu drawer, laid over the page. The home page showed through it, and the drawer's borders ran across the page as stray lines.display: table; width: 100%; overflow: hidden, which turned off the theme'sdisplay: block; overflow-x: auto. At 375px, 8 of the 19 pages checked were wider than the screen; the schema cheatsheet was 870px wide. The cheatsheet also overflowed on tablets: 1140px at 768px and 1206px at 1024px.repo:. Four links also showed two arrows: a typed "↗" plus the theme's external-link icon.What changed
styles/index.scss: the sidebar gets the page background at the mobile breakpoint and below. Tables keep the theme'sdisplay: block; overflow-x: auto, so a wide table scrolls inside itself..vp-homeclips the hero texture withoverflow-x: clip.config.ts: the duplicate GitHub nav entry is removed, since the theme adds one fromrepo:. The typed "↗" is dropped from four link texts.styles/palette.scss:$MQMobile: 1149px. The theme reads its mobile breakpoint from the palette file, in its CSS and in its JS, so below 1150px the navbar links move into the menu drawer.All of it restyles the default theme's existing markup. There is no theme fork and no new component.
Trade-offs
$MQMobileneeds re-measuring when a top-level navbar item is added. The comment next to it says so.How it was checked
npm run docs:build: 43 pages, no warnings.Not checked on a real iPhone or iPad; this used Chrome's device emulation only.