Browse Source

Refactor collapsed comments' @extend usage

Just some small adjustments to how @extend is used here, so that some of
the styles that apply to "fully collapsed" chains don't get brought over
to the "individually collapsed" comments when they're not wanted.

The % syntax is SASS's recommendation for "@extend-only selectors".
merge-requests/37/head
Deimos 6 years ago
parent
commit
5334baa8ff
  1. 12
      tildes/scss/_themes.scss
  2. 24
      tildes/scss/modules/_comment.scss

12
tildes/scss/_themes.scss

@ -116,7 +116,7 @@
.label-comment-tag-flame { @include specialtag($comment-tag-flame-color, $is-light); }
}
.is-comment-collapsed {
%collapsed {
header {
background-color: $background-color;
color: $text-secondary-color;
@ -127,6 +127,16 @@
}
}
.is-comment-collapsed {
@extend %collapsed;
}
.is-comment-collapsed-individual {
& > .comment-itself {
@extend %collapsed;
}
}
.is-comment-deleted, .is-comment-removed {
color: $text-secondary-color;
}

24
tildes/scss/modules/_comment.scss

@ -127,11 +127,7 @@
}
}
.is-comment-collapsed {
&[data-comment-depth="0"] {
border-bottom: 0;
}
%collapsed {
.comment-edited-time,
.comment-nav-link,
.comment-posted-time,
@ -143,10 +139,6 @@
display: none;
}
.comment-branch-counter {
display: inline-block;
}
.comment-excerpt {
display: inline-block;
}
@ -156,11 +148,23 @@
}
}
.is-comment-collapsed {
@extend %collapsed;
&[data-comment-depth="0"] {
border-bottom: 0;
}
.comment-branch-counter {
display: inline-block;
}
}
// uses @extend to only collapse everything inside the collapsed comment itself and
// not its replies
.is-comment-collapsed-individual {
& > .comment-itself {
@extend .is-comment-collapsed;
@extend %collapsed;
}
}

Loading…
Cancel
Save