Skip to content

Commit b936967

Browse files
estradinoclaude
andcommitted
mobile: drawer fills behind the iOS toolbar + instant close (no delay)
Two remaining iOS menu issues from the latest screen recording: - Menu not taking full height: the drawer/overlay were sized to the dynamic viewport (100dvh = the toolbar-shown height), so they ended above the Safari toolbar with a dark band below. Size them to the LARGE viewport instead (100lvh, with a 100vh fallback) so they fill the full screen behind the translucent toolbar — no dark band. This is safe because both are display:none when closed (#283), so they can't pin the layout viewport. - ~0.5s delay on close: the drawer's `display 0.25s allow-discrete` exit kept it in the layout for 0.25s before display:none, so iOS released its pinned viewport (and cleared the gap) only after that delay. Move the transition to the open-state rule so closing is instant; the slide-in still animates (open-state transition + @starting-style). Verified in WebKit: slide-in animates; after close both compute display:none within ~40ms (was ~250ms); drawer/overlay heights resolve to the full viewport. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 827d889 commit b936967

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

public/redesign.css

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,19 @@ body {
9696
gap at the bottom (on scroll-up) after the menu has been opened once, until reload.
9797
`allow-discrete` keeps the slide animation while still ending at display:none. */
9898
display: none;
99-
transition: transform 0.25s ease, display 0.25s allow-discrete;
10099
/* Keep scroll momentum inside the drawer instead of chaining to the page behind
101100
it (which made it hard to scroll the menu back up on iOS). */
102101
overscroll-behavior: contain;
103-
/* Fill the visible viewport with an explicit height instead of relying on the
104-
Tailwind `bottom-0` on this fixed drawer — iOS Safari can resolve that `bottom`
105-
short, leaving the drawer well above the bottom with a dark gap below it. A dvh
106-
height is viewport-relative and reliable. */
102+
/* Fill the FULL screen — including behind the iOS toolbar — so there's no dark band
103+
below the menu. `lvh` is the largest (toolbar-hidden) viewport; the translucent
104+
toolbar floats over the drawer's bottom and the long nav scrolls inside. Safe
105+
because the drawer is display:none when closed, so it can't pin the layout viewport.
106+
The open/close transition lives on the open-state rule below (not here) so closing
107+
is INSTANT — otherwise the drawer lingers ~0.25s before display:none, keeping iOS's
108+
viewport pinned and flashing the gap back (the "weird half-second delay"). */
107109
bottom: auto;
108-
height: calc(100dvh - var(--theme-navbar-height));
110+
height: calc(100vh - var(--theme-navbar-height));
111+
height: calc(100lvh - var(--theme-navbar-height));
109112
}
110113

111114
/* Match the language pill's height to the sidebar's theme-toggle pill (38px) so the
@@ -115,7 +118,7 @@ body {
115118
height: 38px;
116119
}
117120
[dir='rtl'] .or-drawer { transform: translateX(100%); }
118-
body.mobile-sidebar-toggle #mobile-left-sidebar.or-drawer { display: block; transform: translateX(0); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3); }
121+
body.mobile-sidebar-toggle #mobile-left-sidebar.or-drawer { display: block; transform: translateX(0); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3); transition: transform 0.25s ease, display 0.25s allow-discrete; }
119122
/* Slide-in start state (for the display:none → block transition above). */
120123
@starting-style {
121124
body.mobile-sidebar-toggle #mobile-left-sidebar.or-drawer { transform: translateX(-100%); }
@@ -127,7 +130,7 @@ body.mobile-sidebar-toggle #mobile-left-sidebar.or-drawer { display: block; tran
127130
keeps the background fixed. Taps still fire, so tap-to-close keeps working. */
128131
/* display:none when closed (same reason as the drawer above) — keep the overlay out of
129132
the layout so it can't pin iOS Safari's viewport once the menu has been used. */
130-
#mobile-overlay { display: none; transition: opacity 0.25s ease; touch-action: none; }
133+
#mobile-overlay { display: none; bottom: auto; height: 100vh; height: 100lvh; transition: opacity 0.25s ease; touch-action: none; }
131134
body.mobile-sidebar-toggle #mobile-overlay { display: block; opacity: 1 !important; pointer-events: auto !important; }
132135

133136
/* We deliberately do NOT lock the page scroll with `overflow:hidden` on html/body when

0 commit comments

Comments
 (0)