diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 9a78688..e283652 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -19,6 +19,7 @@
export let data: PageData
+ let innerHeight: number
// Fonts to preload
const fonts = [
@@ -58,8 +59,12 @@
// Avoid FOUC
document.body.style.opacity = '1'
})
+
+ $: innerHeight && document.body.style.setProperty('--vh', `${innerHeight}px`)
+
+
{#each fonts as font}
diff --git a/src/style/organisms/_cart.scss b/src/style/organisms/_cart.scss
index 075c707..bfb0e8b 100644
--- a/src/style/organisms/_cart.scss
+++ b/src/style/organisms/_cart.scss
@@ -4,7 +4,7 @@
top: 80px;
right: 0;
width: 100%;
- height: calc(100vh - 80px);
+ height: calc(var(--vh) - 80px);
display: flex;
flex-direction: column;
overflow: auto;
@@ -16,7 +16,7 @@
top: 24px;
right: 24px;
width: clamp(320px, 45vw, 500px);
- height: calc(100vh - 48px);
+ height: calc(var(--vh) - 48px);
max-height: 1000px;
border-radius: 8px;
padding: 24px 32px 32px;
diff --git a/src/style/pages/_viewer.scss b/src/style/pages/_viewer.scss
index b3c81f9..eee7f4d 100644
--- a/src/style/pages/_viewer.scss
+++ b/src/style/pages/_viewer.scss
@@ -1,7 +1,7 @@
:global(.photo-page) {
position: relative;
width: 100vw;
- height: 100vh;
+ height: var(--vh);
display: flex;
align-items: center;
overflow: hidden;