From 94f45564c88b3748555cd446d08d9108f89cc886 Mon Sep 17 00:00:00 2001 From: Alexander Chabin Date: Wed, 20 Dec 2023 10:45:58 +0500 Subject: [PATCH] Move html/body rules to globals.css --- components/AboutProjectModal/Modal/Modal.module.css | 7 ------- styles/globals.css | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/AboutProjectModal/Modal/Modal.module.css b/components/AboutProjectModal/Modal/Modal.module.css index 8a157824..fe1a315a 100644 --- a/components/AboutProjectModal/Modal/Modal.module.css +++ b/components/AboutProjectModal/Modal/Modal.module.css @@ -10,12 +10,6 @@ animation: .2s ease-in-out fadeIn; } -html:has(.Modal[open]), -body:has(.Modal[open]) { - overflow: auto; - height: 100%; -} - .Modal::backdrop { background: rgba(12, 27, 39, .2); } @@ -83,7 +77,6 @@ body:has(.Modal[open]) { .Modal { width: 100%; max-width: 647px; - min-height: auto; max-height: calc(100vh - 112px); margin: 60px auto; border-radius: 16px; diff --git a/styles/globals.css b/styles/globals.css index c4a9d83a..668f78b3 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -20,6 +20,13 @@ html { } } +/* Remove scrollbar when modal open */ +html:has(dialog[open]), +body:has(dialog[open]) { + overflow: auto; + height: 100%; +} + body { overflow-x: hidden; font-weight: 300;