From 8f4277e4a6b25c8dd4f9a16f6c73813c232cb7ef Mon Sep 17 00:00:00 2001 From: Deimos Date: Wed, 12 Sep 2018 21:54:04 -0600 Subject: [PATCH] Don't collapse "target comment" when linked to one This uses the CSS :not(:target) selector to make collapsing have no effect on the "target comment" (the one that's being linked to or navigated to using the Link/Parent links). This isn't really a full solution and the collapsing button will still toggle between + and - when clicked, but it's an improvement anyway. --- tildes/scss/_themes.scss | 10 +++++----- tildes/scss/modules/_comment.scss | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tildes/scss/_themes.scss b/tildes/scss/_themes.scss index a6cce8c..8e4ef3d 100644 --- a/tildes/scss/_themes.scss +++ b/tildes/scss/_themes.scss @@ -119,7 +119,7 @@ .label-comment-tag-flame { @include specialtag($comment-tag-flame-color, $is-light); } } - %collapsed { + %collapsed-theme { header { background-color: $background-color; color: $text-secondary-color; @@ -130,13 +130,13 @@ } } - .is-comment-collapsed { - @extend %collapsed; + .is-comment-collapsed:not(:target) { + @extend %collapsed-theme; } - .is-comment-collapsed-individual { + .is-comment-collapsed-individual:not(:target) { & > .comment-itself { - @extend %collapsed; + @extend %collapsed-theme; } } diff --git a/tildes/scss/modules/_comment.scss b/tildes/scss/modules/_comment.scss index 792b6bb..bdfd61c 100644 --- a/tildes/scss/modules/_comment.scss +++ b/tildes/scss/modules/_comment.scss @@ -148,7 +148,7 @@ } } -.is-comment-collapsed { +.is-comment-collapsed:not(:target) { @extend %collapsed; &[data-comment-depth="0"] { @@ -162,7 +162,7 @@ // uses @extend to only collapse everything inside the collapsed comment itself and // not its replies -.is-comment-collapsed-individual { +.is-comment-collapsed-individual:not(:target) { & > .comment-itself { @extend %collapsed; }