Browse Source

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.
merge-requests/37/head
Deimos 6 years ago
parent
commit
8f4277e4a6
  1. 10
      tildes/scss/_themes.scss
  2. 4
      tildes/scss/modules/_comment.scss

10
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;
}
}

4
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;
}

Loading…
Cancel
Save