From 884fec6c5f1c2e2695a20d028e33ba1238462c51 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Thu, 1 Sep 2022 18:25:21 +0300 Subject: [PATCH] hopefully fix mobile viewport issues --- frontend/public/global.css | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/frontend/public/global.css b/frontend/public/global.css index e5abb75..af6f0b3 100644 --- a/frontend/public/global.css +++ b/frontend/public/global.css @@ -71,15 +71,23 @@ } html, body { - margin: 0; padding: 0; + margin: 0; + + color-scheme: dark; + accent-color: var(--purple-2); + width: 100%; height: 100%; + min-width: 100%; + min-height: 100%; + max-width: 100%; + max-height: 100%; } body { - color-scheme: dark; - accent-color: var(--purple-2); + overflow: hidden; + padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); color: var(--foreground-color-1); background-color: var(--background-color-1); font-size: 100%; @@ -89,7 +97,22 @@ body { display: flex; flex-direction: column; - overflow: hidden; +} + +@supports(height: 1dvw) { + html, body { + min-width: 100dvw; + max-width: 100dvw; + width: 100dvw; + } +} + +@supports(height: 1dvh) { + html, body { + min-height: 100dvh; + max-height: 100dvh; + height: 100dvh; + } } /* fullscreen message */