Skip to content

Commit 3be0f62

Browse files
saimalshaficlaude
andcommitted
Fix standalone spacing via JS detection instead of CSS-only media query
window.navigator.standalone is the reliable iOS Safari "Add to Home Screen" detector — the CSS @media (display-mode: standalone) query can miss it. Sets data-standalone on <html> so CSS vars pick up safe-area-inset-bottom. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 81b389a commit 3be0f62

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Feather.jsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,10 @@ const GlobalStyle = (
340340
--content-bottom: calc(env(safe-area-inset-bottom, 0px) + 46px);
341341
}
342342
}
343+
[data-standalone="true"] {
344+
--bottom-gap: calc(env(safe-area-inset-bottom, 0px) + 4px) !important;
345+
--content-bottom: calc(env(safe-area-inset-bottom, 0px) + 46px) !important;
346+
}
343347
.feather-noscroll::-webkit-scrollbar { display: none; }
344348
.feather-noscroll { scrollbar-width: none; -ms-overflow-style: none; }
345349
@keyframes featherPulse {
@@ -487,6 +491,14 @@ export default function Feather() {
487491
}
488492
}, []);
489493

494+
// ----- Standalone detection: set data-standalone on <html> for reliable PWA spacing -----
495+
useEffect(() => {
496+
const standalone =
497+
window.navigator.standalone === true ||
498+
window.matchMedia("(display-mode: standalone)").matches;
499+
if (standalone) document.documentElement.setAttribute("data-standalone", "true");
500+
}, []);
501+
490502
// ----- Boot: geolocate -----
491503
const didBoot = useRef(false);
492504
useEffect(() => {

0 commit comments

Comments
 (0)