From 4e53a8654441481029746ff4e35a4a19c8d83709 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 17 May 2022 18:43:24 +0200 Subject: chore: make some widgets scrollable (like ToC) --- src/components/molecules/layout/widget.module.scss | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/components/molecules/layout/widget.module.scss') diff --git a/src/components/molecules/layout/widget.module.scss b/src/components/molecules/layout/widget.module.scss index 5854206..27d7ffd 100644 --- a/src/components/molecules/layout/widget.module.scss +++ b/src/components/molecules/layout/widget.module.scss @@ -1,4 +1,5 @@ @use "@styles/abstracts/functions" as fun; +@use "@styles/abstracts/mixins" as mix; .widget { display: flex; @@ -32,6 +33,25 @@ } } + &--expanded#{&}--has-scroll { + @include mix.media("screen") { + @include mix.dimensions("lg") { + max-height: 95vh; + + .widget__body { + overflow: hidden; + } + + &:hover, + &:focus-within { + .widget__body { + overflow-y: auto; + } + } + } + } + } + &--expanded & { &__body { max-height: 10000px; // needs a fixed value for transition. -- cgit v1.2.3