From 84d04961a8fc91765837746e98545e8f109a9aa6 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 18 Jul 2025 08:27:08 -0700 Subject: fix notch spacing --- src/routes/+layout.svelte | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 2b3c99bf..7e0d28a5 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -25,12 +25,13 @@ $installPrompt = event; }); - if (typeof window.AndroidNotch !== "undefined") { + let hasNotch = typeof window.AndroidNotch !== "undefined"; + if (hasNotch) { window.AndroidNotch.getInsetTop( (px) => { document.documentElement.style.setProperty( "--safe-area-inset-top", - px + "px", + Math.round(px) + "px", ); }, (err) => { @@ -42,7 +43,7 @@ (px) => { document.documentElement.style.setProperty( "--safe-area-inset-bottom", - px + "px", + 24 + "px", ); }, (err) => { @@ -85,7 +86,7 @@ --toastContainerLeft: calc(50vw - 8rem); --toastBackground: #292929; - --safe-area-inset-top: 24px; + --safe-area-inset-top: 0px; --safe-area-inset-bottom: 0px; } -- cgit v1.2.3