From ffe5150a835f9ecc1b0ca45a386ca725da526d69 Mon Sep 17 00:00:00 2001 From: Brian Miller Date: Mon, 25 Jul 2022 11:00:52 -0500 Subject: [PATCH 1/2] Adjust comment stream css to account for comment count Move max-height and hidding of overflow done from the wrapper to the actual comment stream. This allows use to account for the where there are no comments or a single comment displaying the whole stream. By default now the $comment-start-height ~ max-height will be applyed stream instead of the wrapper(stream + toggle button). It will also not set it when there are no comments or only a single comment. Also moved the show comments transition when the toggle button is pressed. --- .../scss/components/_comments.scss | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/marko-web-theme-monorail/scss/components/_comments.scss b/packages/marko-web-theme-monorail/scss/components/_comments.scss index 54db1c905..864273c46 100644 --- a/packages/marko-web-theme-monorail/scss/components/_comments.scss +++ b/packages/marko-web-theme-monorail/scss/components/_comments.scss @@ -31,14 +31,21 @@ $bottom-gradient-height: 180px !default; } } .idx-comment-stream-wrapper { - max-height: $comment-start-height; - overflow: hidden; display: flex; flex-direction: column; margin-top: 24px; border-radius: 4px; border: 1px solid $gray-200; + .idx-comment-stream { + &:not(.idx-comment-stream__counter--1) { + max-height: $comment-start-height; + } + } &--open { + .idx-comment-stream { + max-height: 100%; + overflow: visible; + } height: initial; max-height: initial; .idx-comment-stream ~ .comment-stream__toggle-btn { @@ -52,7 +59,6 @@ $bottom-gradient-height: 180px !default; .idx-comment-stream { $self: &; - max-height: 100%; overflow: hidden; position: relative; display: block; From bc2f36009bd4f008341df34f6f93a00b061b84cc Mon Sep 17 00:00:00 2001 From: Brian Miller Date: Mon, 25 Jul 2022 11:19:57 -0500 Subject: [PATCH 2/2] =?UTF-8?q?account=20for=20=E2=80=94open=20and=20show?= =?UTF-8?q?=20all=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../marko-web-theme-monorail/scss/components/_comments.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/marko-web-theme-monorail/scss/components/_comments.scss b/packages/marko-web-theme-monorail/scss/components/_comments.scss index 864273c46..b57434269 100644 --- a/packages/marko-web-theme-monorail/scss/components/_comments.scss +++ b/packages/marko-web-theme-monorail/scss/components/_comments.scss @@ -39,12 +39,17 @@ $bottom-gradient-height: 180px !default; .idx-comment-stream { &:not(.idx-comment-stream__counter--1) { max-height: $comment-start-height; + overflow: hidden; } } &--open { .idx-comment-stream { max-height: 100%; overflow: visible; + &:not(.idx-comment-stream__counter--1) { + max-height: initial; + overflow: visible; + } } height: initial; max-height: initial; @@ -59,7 +64,6 @@ $bottom-gradient-height: 180px !default; .idx-comment-stream { $self: &; - overflow: hidden; position: relative; display: block; padding-top: map-get($spacers, block);