From f2bf1b9cc62cdadb70460e16e666324959528635 Mon Sep 17 00:00:00 2001 From: Speculator55005 <50082482+fas89@users.noreply.github.com> Date: Sun, 15 Nov 2026 11:20:32 +0100 Subject: [PATCH] docs: fix the site's layout on phones and tablets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- docs/.vuepress/config.ts | 9 ++++----- docs/.vuepress/styles/index.scss | 21 +++++++++++++++++---- docs/.vuepress/styles/palette.scss | 10 ++++++++++ 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index 9cc39f1..d6f2f6e 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -87,8 +87,8 @@ export default defineUserConfig({ { text: 'Specification', link: '/schema/specification' }, { text: 'Versions', link: '/schema/versions' }, { text: 'Changelog', link: '/schema/changelog' }, - { text: 'JSON Schema 0.7.6 (stable) ↗', link: 'https://open-data-protocol.github.io/fluid/schema/fluid-schema-0.7.6.json', target: '_blank' }, - { text: 'Reference 0.7.6 (HTML) ↗', link: 'https://open-data-protocol.github.io/fluid/specs/0.7.6/fluid-spec.html', target: '_blank' }, + { text: 'JSON Schema 0.7.6 (stable)', link: 'https://open-data-protocol.github.io/fluid/schema/fluid-schema-0.7.6.json', target: '_blank' }, + { text: 'Reference 0.7.6 (HTML)', link: 'https://open-data-protocol.github.io/fluid/specs/0.7.6/fluid-spec.html', target: '_blank' }, { text: 'Preview: 0.7.7', link: '/releases/0.7.7' }, ], }, @@ -100,12 +100,11 @@ export default defineUserConfig({ text: 'Project', children: [ { text: 'Contributing', link: '/contributing/' }, - { text: 'Governance ↗', link: 'https://github.com/open-data-protocol/fluid/blob/main/GOVERNANCE.md', target: '_blank' }, - { text: 'Conformance Corpus ↗', link: 'https://github.com/open-data-protocol/fluid/blob/main/tests/README.md', target: '_blank' }, + { text: 'Governance', link: 'https://github.com/open-data-protocol/fluid/blob/main/GOVERNANCE.md', target: '_blank' }, + { text: 'Conformance Corpus', link: 'https://github.com/open-data-protocol/fluid/blob/main/tests/README.md', target: '_blank' }, { text: 'Vision', link: '/vision/' }, ], }, - { text: 'GitHub', link: 'https://github.com/open-data-protocol/fluid' }, ], sidebar: { diff --git a/docs/.vuepress/styles/index.scss b/docs/.vuepress/styles/index.scss index b3c5b24..ffff4ec 100644 --- a/docs/.vuepress/styles/index.scss +++ b/docs/.vuepress/styles/index.scss @@ -62,6 +62,14 @@ body { // Homepage hero (.vp-hero) — eyebrow pill, animated gradient headline, // pill CTAs, faint engineering-grid texture. // --------------------------------------------------------------------- + +// The grid texture below bleeds 8vw past the hero, more than the home +// page's side padding below about 1100px wide, so phones and tablets could +// scroll sideways. `clip` trims only that bleed and keeps vertical overflow. +.vp-home { + overflow-x: clip; +} + .vp-hero { position: relative; isolation: isolate; @@ -240,6 +248,12 @@ body { .vp-sidebar { background: transparent; + // At the mobile breakpoint and below the sidebar is a drawer laid over + // the page, so it needs a solid surface or the page shows through the menu. + @media (max-width: palette.$MQMobile) { + background: var(--vp-c-bg); + } + .sidebar-item.active { color: var(--vp-c-accent); font-weight: 600; @@ -308,14 +322,13 @@ div[class*="language-"] { } // --------------------------------------------------------------------- -// Tables — full width, alternating rows. +// Tables — alternating rows. Keep the theme's `display: block` and +// `overflow-x: auto`: a table wider than the column then scrolls inside +// itself instead of widening the whole page on phones and tablets. // --------------------------------------------------------------------- [vp-content] table { - display: table; - width: 100%; border-collapse: collapse; border-radius: 10px; - overflow: hidden; th { background: var(--vp-c-bg-alt); diff --git a/docs/.vuepress/styles/palette.scss b/docs/.vuepress/styles/palette.scss index b405570..d0fa436 100644 --- a/docs/.vuepress/styles/palette.scss +++ b/docs/.vuepress/styles/palette.scss @@ -34,6 +34,16 @@ $ff-indigo: #818cf8; $ff-amber: #f59e0b; // "warning" callout semantics only $ff-red: #ef4444; // "danger" callout semantics only +// --------------------------------------------------------------------- +// Mobile breakpoint. The default theme reads it from this file; its own +// default is 719px. The navbar's links, search box and color-mode toggle +// need about 1120px. Narrower than that, the links pushed the search box +// and the toggle off screen on landscape phones and tablets, so at 1149px +// and below the links move into the menu drawer instead. Re-measure this +// when you add a top-level navbar item. +// --------------------------------------------------------------------- +$MQMobile: 1149px; + // ===================================================================== // DARK (default) — on :root so the first paint is dark. // =====================================================================