_response.scss 4.75 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
// discussion - responses
// ====================

// Table of Contents
// * +wrapper - response list
// * +base - single response element
// * +element - add response area
// * +response - labels and banners
// * +CASE: answered question - collapsed comments in answers
// * +response - labels and banners
// * +comments styling

// +wrapper - response list
14
.discussion .responses {
15
  @extend %ui-no-list;
16 17 18 19 20 21 22

  &:empty {
    display: none;
  }

  // wrapper - response plus comment area
  .forum-response {
23
    animation: fadeIn 0.3s;
24 25
    position: relative;
    margin: $baseline 0;
26
    border: 1px solid $forum-color-border;
27
    border-radius: $forum-border-radius;
28 29 30 31 32
    box-shadow: 0 0 1px $shadow;
  }

  // wrapper - main response area
  .discussion-response {
33
    box-sizing: border-box;
34

35
    @include border-radius($forum-border-radius, $forum-border-radius, 0, 0);
36

37
    padding: $baseline;
38
    background-color: $forum-color-background;
39 40 41 42 43 44 45 46
  }
  
  .posted-by {
    @extend %t-ultrastrong;
  }
}

// +base - single response element
47
.discussion-response {
48 49 50 51 52
  .response-header-content {

    // CASE: larger username for responses 
    .username {
      @extend %t-weight5;
53

54
      font-size: $forum-base-font-size;
55 56 57 58 59 60 61 62 63 64 65
    }
  }

  // rtl resets for response list elements
  .response-body ol, .response-body ul { // Fix up the RTL-only _reset.scss, but only in specific places
    @include padding-left($baseline*2);
    @include padding-right(0);
  }
}

// +element - add response area
66
.discussion .add-response {
67 68
  display: inline;
  padding: $baseline/2;
69 70 71
}

// +CASE: answered question - collapsed comments in answers
72
.forum-response .action-show-comments {
73
  font-size: $forum-base-font-size;
74
  box-sizing: border-box;
75 76 77
  display: block;
  padding: ($baseline/2) $baseline;
  width: 100%;
78
  background: theme-color("lightest");
79 80
  box-shadow: 0 1px 3px -1px $shadow inset;
}
81 82 83

// +response - labels and banners
// NOTE - these styles seem to no longer be in use. They have been isolated here, but should be ideally removed or fixed. 
84
.discussion .responses .forum-response {
85 86 87 88 89 90 91 92

  // CASE: label - staff response
  &.staff {
    padding-top: 38px;
    border-color: #009fe2;
  }

  // CASE: label - community TA response
93
  &.community-ta {
94 95 96 97 98 99
    padding-top: 38px;
    border-color: $forum-color-community-ta;
  }

  // CASE: banner - staff response
  .staff-banner {
100
    @include border-radius($forum-border-radius, $forum-border-radius, 0, 0);
101
    @include left(0);
102

103 104 105 106 107
    position: absolute;
    top: 0;
    width: 100%;
    height: 14px;
    padding: 1px ($baseline/4);
108
    box-sizing: border-box;
109
    background: #009fe2;
110
    font-size: $forum-small-font-size;
111 112 113 114 115
    font-weight: 700;
    color: $white;
  }

  // CASE: banner - community TA response
116
  .community-ta-banner {
117 118
    @include border-radius($forum-border-radius, $forum-border-radius, 0, 0);
    @include left(0);
119

120 121 122 123 124
    position: absolute;
    top: 0;
    width: 100%;
    height: 14px;
    padding: 1px ($baseline/4);
125
    box-sizing: border-box;
126
    background: $forum-color-community-ta;
127
    font-size: $forum-small-font-size;
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
    font-weight: 700;
    color: $white;
  }

  // STATE: loading - response list
  &.loading {
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
  }
}

// +comments styling
143
.discussion .comments {
144
  @extend %ui-no-list;
145

146
  @include border-radius(0, 0, $forum-border-radius, $forum-border-radius);
147

148
  background: theme-color("lightest");
149 150 151
  box-shadow: 0 1px 3px -1px $shadow inset;

  > li {
152
    border-top: 1px solid $forum-color-border;
153
    padding: ($baseline/2) $baseline;
154
    position: relative;
155 156 157
  }

  blockquote {
158
    background: $forum-color-background-light;
159
    border-radius: $forum-border-radius;
160
    padding: ($baseline/4) ($baseline/2);
161
    font-size: $forum-base-font-size;
162 163 164 165
  }

  .comment-form {
    @include clearfix();
166

167
    padding: ($baseline/2) 0;
168 169 170

    .comment-form-input {
      padding: ($baseline/4) ($baseline/2);
171
      background-color: $forum-color-background;
172
      font-size: $forum-base-font-size;
173 174 175
    }

    .discussion-submit-comment {
176
      @include float(left);
177

178 179 180 181
      margin-top: 8px;
    }

    .wmd-input {
182
      @include transition(all .2s linear 0s);
183

184 185 186 187 188 189 190 191
      height: 40px;
    }

    .discussion-errors {
      margin: 0;
    }
  }
}
192 193 194

.response-count {
  @include float(right);
195
  @include margin-right($baseline / 2);
196

197 198 199 200 201 202
  color: $forum-color-response-count;
  font-size: $forum-base-font-size;
}

.response-pagination {
  visibility: visible;
203
  margin: ($baseline / 2) 0;
204 205 206 207 208 209 210 211 212 213 214 215 216 217

  &:empty {
    visibility: hidden;
  }

  .response-display-count {
    display: block;
    padding: ($baseline/2) 0;
    color: $forum-color-response-count;
    font-size: $forum-base-font-size;
  }

  .load-response-button {
    @include text-align(left);
218

219 220 221 222 223
    position: relative;
    margin: ($baseline/2) 0;
    width: 100%;
  }
}