Skip to content

docs: fix the site's layout on phones and tablets - #54

Merged
fas89 merged 1 commit into
open-data-protocol:mainfrom
fas89:docs/phone-and-tablet-layout
Nov 15, 2026
Merged

fas89 merged 1 commit into
open-data-protocol:mainfrom
fas89:docs/phone-and-tablet-layout

Conversation

@fas89

@fas89 fas89 commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

What was wrong

On phones and tablets the site had five layout problems:

  • The menu was see-through. .vp-sidebar is 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.
  • 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 was 870px wide. The cheatsheet also overflowed on tablets: 1140px at 768px and 1206px at 1024px.
  • The home page was 6px too wide. The hero's grid texture bled past the page.
  • GitHub was in the navbar twice, once from the nav list and once from repo:. Four links also showed two arrows: a typed "↗" plus the theme's external-link icon.
  • The navbar was cut off from 720px to about 1120px wide, which covers landscape phones and iPads. The nine links pushed the search box and the color-mode toggle off screen.

What changed

  • styles/index.scss: the sidebar gets the page background at the mobile breakpoint and below. Tables keep the theme's display: block; overflow-x: auto, so a wide table scrolls inside itself. .vp-home clips the hero texture with overflow-x: clip.
  • config.ts: the duplicate GitHub nav entry is removed, since the theme adds one from repo:. 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

  • Tablets from 720px to 1149px wide get the menu drawer and full-width content instead of a sidebar that is always on screen.
  • On desktop, a table that fits its column is now as wide as its content instead of being stretched to the full column. This is the theme's default.
  • $MQMobile needs 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.
  • Headless Chrome against the built site, all 42 pages at 360, 375, 393, 768, 1024, 1149 and 1150px: no page is wider than the screen, and nothing in the navbar is off screen.
  • The navbar at 13 widths from 375px to 1440px: the menu button shows at 1149px and below. At 1150px and wider, all nine links fit beside the search box and the toggle.
  • The menu drawer at 768, 1024 and 1149px: it opens on top of the page, has a solid background in dark and light mode, and lists every navbar link, with GitHub once.
  • An earlier pass over 19 pages at 1440px: three wide tables, two on the cheatsheet and one on the releases page, now scroll inside themselves.

Not checked on a real iPhone or iPad; this used Chrome's device emulation only.

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.
@fas89
fas89 merged commit 472fada into open-data-protocol:main Nov 15, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant