Skip to content

Commit 9587e2b

Browse files
author
rgilks
committed
Fix iOS PWA black gap with oversized background fallback
The viewport height can be miscalculated on iOS PWA initial load, causing position:fixed elements to stop short of the physical screen edge. Two fixes: - Add min-height: -webkit-fill-available to html/body - Add body::after with inset: -100px as a background safety net that extends beyond the viewport to cover any gap
1 parent a513501 commit 9587e2b

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

static/style.css

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ html,
4444
body {
4545
width: 100%;
4646
height: 100%;
47+
min-height: 100vh;
48+
min-height: 100dvh;
49+
min-height: -webkit-fill-available;
4750
overscroll-behavior: none;
4851
}
4952

5053
body {
51-
min-height: 100vh;
52-
min-height: 100dvh;
5354
overflow: hidden;
5455
color: var(--text);
5556
font-family: var(--font-display);
@@ -71,6 +72,15 @@ body::before {
7172
opacity: 0.7;
7273
}
7374

75+
body::after {
76+
content: '';
77+
position: fixed;
78+
inset: -100px;
79+
background: var(--bg);
80+
z-index: -1;
81+
pointer-events: none;
82+
}
83+
7484
#gameCanvas {
7585
position: fixed;
7686
inset: 0;

0 commit comments

Comments
 (0)