diff --git a/app/globals.css b/app/globals.css index bf2dc3da4..f6478a029 100644 --- a/app/globals.css +++ b/app/globals.css @@ -52,6 +52,17 @@ html.dark { --bg-subtle: rgba(255,255,255,0.04); } +/* WebKit reports dvh/innerHeight without the status-bar strip for installed + home-screen apps even though the layout still starts at the screen's top. + In standalone mode there is no browser toolbar to make vh unstable, and vh + includes that missing strip. The keyboard hook temporarily overrides this + custom property with visualViewport.height while an editor is focused. */ +@media (display-mode: standalone) { + :root { + --app-viewport-height: 100vh; + } +} + .catppuccin-file-icon { display: block; flex-shrink: 0; diff --git a/components/MobilePwaLayout.test.mjs b/components/MobilePwaLayout.test.mjs index 043f398ee..c166dfb60 100644 --- a/components/MobilePwaLayout.test.mjs +++ b/components/MobilePwaLayout.test.mjs @@ -13,6 +13,7 @@ test("configures iOS standalone mode to use the full screen", () => { assert.match(layoutSource, /statusBarStyle: "black-translucent"/); assert.match(layoutSource, /viewportFit: "cover"/); assert.match(layoutSource, /interactiveWidget: "resizes-content"/); + assert.match(cssSource, /@media \(display-mode: standalone\) \{[\s\S]*?--app-viewport-height: 100vh;/); }); test("tracks the visual viewport while the software keyboard is open", () => {