diff --git a/website/src/components/HeadCommon.astro b/website/src/components/HeadCommon.astro index dcf9af3b..002a5a92 100644 --- a/website/src/components/HeadCommon.astro +++ b/website/src/components/HeadCommon.astro @@ -80,4 +80,13 @@ const { strudelTheme } = settings; } setTheme(get().theme); watch(setTheme, 'theme'); + // https://medium.com/quick-code/100vh-problem-with-ios-safari-92ab23c852a8 + const appHeight = () => { + const doc = document.documentElement; + doc.style.setProperty('--app-height', `${window.innerHeight}px`); + }; + if (typeof window !== 'undefined') { + window.addEventListener('resize', appHeight); + appHeight(); + } diff --git a/website/src/layouts/MainLayout.astro b/website/src/layouts/MainLayout.astro index ac268cab..49952a7e 100644 --- a/website/src/layouts/MainLayout.astro +++ b/website/src/layouts/MainLayout.astro @@ -30,7 +30,7 @@ const githubEditUrl = `${CONFIG.GITHUB_EDIT_URL}/${currentFile}`; -
+