From 84ea1bd71fb82ed594af217d8362339288276870 Mon Sep 17 00:00:00 2001 From: David Hill <1879069+iamdavidhill@users.noreply.github.com> Date: Sun, 8 Nov 2026 10:46:59 -0600 Subject: [PATCH] fix(site): make the phone sticky rows full width so their tap fill reaches both edges (#62759) --- .../site/src/component/site/on-this-page.css | 25 +++++++++++++------ services/site/src/docs/styles/docs.css | 22 +++++++++++----- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/services/site/src/component/site/on-this-page.css b/services/site/src/component/site/on-this-page.css index 152863a2b2c..01a8c04137e 100644 --- a/services/site/src/component/site/on-this-page.css +++ b/services/site/src/component/site/on-this-page.css @@ -245,16 +245,24 @@ display: block; background: var(--bg); - /* At rest the bar has no lines. Pinned (data-stuck, from ContentsMenu), a line fades in above + /* The row itself spans the screen (its padding puts the label and chevron back on the content + edge and the menu column), so its press fill does too. A fill painted past a narrower box + (border-image's outset) is clipped to that box on iOS, where the sticky bar is its own layer. + At rest the bar has no lines. Pinned (data-stuck, from ContentsMenu), a line fades in above and below it, each across the whole screen. The top line sits on the row above the bar, where the bar above (the top bar's hairline, or the legal tabs' divider) already draws its own and paints over it, so there's only ever one line there. Nothing moves when they show; the bar's background stays a hard cut. */ + summary { + margin-inline: calc(-1 * var(--edge)); + padding-inline: var(--edge); + } + summary::before, summary::after { content: ""; position: absolute; - inset-inline: calc(-1 * var(--edge)); + inset-inline: 0; height: 1px; background: var(--border); pointer-events: none; @@ -294,8 +302,9 @@ } /* The label and the items start at the page content's edge, at body size; the items are 44px+ - rows (17px Inter at 1.4 plus 11px above and below). The current item's pipe sits on the screen's - edge; the open list spans the margins for that. */ + rows (17px Inter at 1.4 plus 11px above and below). The open list spans the screen and so does + each row (its padding keeps the label on the content edge), so a row's press fill and the + current item's pipe reach the screen's edges. */ summary { font-size: var(--body-size); } @@ -307,25 +316,25 @@ ul { inset-inline-start: calc(-1 * var(--edge)); inset-inline-end: calc(-1 * var(--edge)); - padding-inline: var(--edge); + padding-inline: 0; } /* Each row of the open list is as tall as the bar (--row-height). */ a { --rail-pad: calc((var(--contents-height) - 1lh) / 2); - padding-inline-start: 0; + padding-inline: var(--edge); font-size: var(--body-size); /* The current row's bar is on the screen's edge and as tall as the whole row. */ &::before { - inset-inline-start: calc(-1 * var(--edge)); + inset-inline-start: 0; top: 0; height: 100%; } } li[data-level="3"] a { - padding-inline-start: 1rem; + padding-inline-start: calc(var(--edge) + 1rem); } } diff --git a/services/site/src/docs/styles/docs.css b/services/site/src/docs/styles/docs.css index 594e35061a6..b8dd31371f7 100644 --- a/services/site/src/docs/styles/docs.css +++ b/services/site/src/docs/styles/docs.css @@ -212,11 +212,6 @@ font-size: var(--mono-size); } - /* The open list's current-item bar sits on the screen's edge; the labels stay on the content edge. */ - [data-component="contents-menu"] a::before { - inset-inline-start: calc(-1 * var(--edge)); - } - [data-component="sidebar"][data-section-nav] { position: sticky; top: calc(var(--topbar-height) + env(safe-area-inset-top, 0px)); @@ -232,14 +227,19 @@ [data-component="section-nav"] { position: relative; + /* The row spans the screen, its padding putting the label and chevron back in place, so its + press fill reaches both edges (on-this-page.css says why a painted outset isn't enough). */ [data-slot="section-toggle"] { position: relative; + width: calc(100% + 2 * var(--edge)); + margin-inline: calc(-1 * var(--edge)); + padding-inline: var(--edge); &::before, &::after { content: ""; position: absolute; - inset-inline: calc(-1 * var(--edge)); + inset-inline: 0; height: 1px; background: var(--border); pointer-events: none; @@ -285,6 +285,16 @@ overscroll-behavior: contain; background: var(--bg); border-bottom: 1px solid var(--border); + + /* Each page is a row across the whole list, filled edge to edge while pressed. */ + [data-component="docs-nav"] a { + margin-inline: calc(-1 * var(--edge)); + padding-inline: var(--edge); + + &:active { + background: var(--row-press); + } + } } } }