_navigation.scss 8.36 KB
Newer Older
Greg Price committed
1 2 3
// discussion - elements - navigation
// ====================

4
// ------
5 6 7
// Discussion Forums Page Header
// ------
.discussion-board > .page-header {
8 9 10 11
  .has-breadcrumbs .breadcrumbs {
    margin-bottom: ($baseline / 2);
    font-size: font-size(base);
    font-weight: font-weight(semi-bold);
12
    line-height: $line-height-base;
13
  }
14 15
}

16 17 18 19
// -----------
// Browse menu
// -----------
.forum-nav-browse-menu-wrapper {
20
  border-bottom: 1px solid $forum-color-border;
21
  background: theme-color("light");
22 23 24
}

.forum-nav-browse-filter {
25 26 27
  position: relative;
  border-bottom: 1px solid $forum-color-border;
  padding: ($baseline/4);
28 29 30
}

.forum-nav-browse-filter .icon {
31 32 33 34 35 36
  @include right($baseline/4 + 1px + $baseline / 4); // Wrapper padding + border + input padding

  font-size: $forum-small-font-size;
  position: absolute;
  margin-top: -6px;
  top: 50%;
37 38 39
}

.forum-nav-browse-filter-input {
40
  width: 100%;
41 42
}

43
.forum-nav-browse-menu-following {
44 45 46 47 48 49 50 51 52 53 54
  .icon {
    @include float(left);
    @include left($baseline / 2);

    position: relative;
    top: 13px;
  }

  .forum-nav-browse-title {
    @include padding-left($baseline * 1.5);
  }
55 56 57 58 59 60
}

.forum-nav-browse-menu-item {
  margin-bottom: 0;
}

61
.forum-nav-browse-title {
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
  @include text-align(left);

  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid $forum-color-border;
  padding: ($baseline/2);
  background: transparent;
  box-shadow: none;
  background-image: none;
  cursor: pointer;

  &:hover,
  &:focus,
  &.is-focused {
    // switched from a to button;
    // need to override button styles
    background-image: none !important;
    box-shadow: none !important;
    background: $forum-color-background !important;
  }
84 85 86
}

.forum-nav-browse-title .icon {
87
  @include margin-right($baseline/2);
88 89
}

90
.forum-nav-browse-menu {
91 92 93
  @include padding-left(0);

  margin: 0;
94 95 96
  font-size: $forum-base-font-size;
  overflow-y: scroll;
  list-style: none;
97
  max-height: 600px;
98 99 100
}

.forum-nav-browse-submenu {
101
  list-style: none;
102
  margin: 0;
103
  padding: 0;
104

105 106 107
  li {
    .forum-nav-browse-title {
      @include padding-left($baseline);
108
    }
109
  }
110 111
}

112 113 114
// -------------------
// Sort and filter bar
// -------------------
115

116
.forum-nav-refine-bar {
117 118 119 120 121
  @include clearfix();
  @include border-radius($forum-border-radius, $forum-border-radius, 0, 0);

  font-size: $forum-small-font-size;
  border-bottom: 1px solid $forum-color-border;
122
  background-color: theme-color("light");
123 124
  padding: ($baseline/4) ($baseline/2);
  color: $black;
125 126 127
}

.forum-nav-filter-main {
128 129 130 131 132
  @include text-align(left);
  @include float(left);

  box-sizing: border-box;
  width: 50%;
133 134 135
}

.forum-nav-filter-cohort, .forum-nav-sort {
136 137 138
  @include text-align(right);

  box-sizing: border-box;
139
}
140

141
.forum-nav-filter-cohort {
142 143 144 145 146 147
  .discussion-board & {
    @include float(right);
    @include text-align(right);

    width: 50%;
  }
148 149
}

150
.forum-nav-sort {
151
  @include float(right);
152 153
}

154
%forum-nav-select {
155 156 157
  border: none;
  max-width: 100%;
  background-color: transparent;
158 159
}

160
.forum-nav-filter-main-control {
161
  @extend %forum-nav-select;
162 163
}

164
.forum-nav-filter-cohort-control {
165 166 167
  @extend %forum-nav-select;

  max-width: 60%;
168 169 170
}

.forum-nav-sort-control {
171
  @extend %forum-nav-select;
172 173
}

Greg Price committed
174 175 176 177
// -----------
// Thread list
// -----------
.forum-nav-thread-list {
178 179
  padding-left: 0 !important; // should *not* be RTLed, see below for explanation
  min-height: 60px;  // @TODO: Remove this when we have a real empty state for the discussion thread list
180 181
  max-height: 800px;
  border-bottom: 1px solid theme-color("light");
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
  margin: 0;
  overflow-y: auto;
  list-style: none;
  border-radius: 0 0 3px 3px;

  .forum-nav-thread-labels {
    margin: 5px 0 0;
    // Overrides overspecific courseware CSS from:
    // https://github.com/edx/edx-platform/blob/master/lms/static/sass/course/courseware/_courseware.scss#L470
    // note this should *not* be RTLed, as the rule it overrides is not RTLed
    padding-left: 0 !important;
  }

  .thread-preview-body {
    margin-top: $baseline / 4;
    color: $forum-color-response-count;
    font-size: $forum-small-font-size;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
202

203 204 205 206
    @include rtl {
      // This is counterintuitive, but when showing a preview of the first part of RTL text, using direction: rtl
      // will actually show the _last_ part of that text.
      direction: ltr;
207
    }
208
  }
Greg Price committed
209 210
}

211 212
// Overrides underspecific styles from courseware css
.course-wrapper .course-content .forum-nav-thread-list-wrapper .forum-nav-thread-list {
213
  @include padding-left(0);
214

215 216 217 218 219
  list-style: none;

  .forum-nav-thread {
    margin: 0;
  }
220 221
}

222
.forum-nav-thread {
223 224 225 226 227 228
  border-bottom: 1px solid $forum-color-border;
  background-color: $forum-color-background;
  margin-bottom: 0;

  &:last-child {
    // Overrides pattern library default li:last-child style
229
    border-bottom: 1px solid $forum-color-border;
230 231 232 233 234 235 236 237 238 239 240
  }

  .forum-nav-thread-link {
    @include border-left(3px solid transparent);

    display: flex;
    padding: $baseline / 2;
    transition: none;
    align-items: center;
    justify-content: space-between;
    color: $forum-color-read-post;
241

242 243 244 245
    &:hover,
    &:active,
    &:focus {
      text-decoration: none;
246 247
    }

248 249
    &:hover {
      background-color: $forum-color-hover-thread;
250
    }
251

252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267
    &.is-active {
      background-color: $forum-color-reading-thread;
    }

    .forum-nav-thread-unread-comments-count {
      display: inline-block;
      font-size: $forum-small-font-size;
      white-space: nowrap;
    }
  }

  &.never-read {
    .forum-nav-thread-link {
      @include border-left(3px solid $forum-color-never-read-post);

      color: $forum-color-never-read-post;
268
    }
269
  }
Greg Price committed
270 271 272
}

%forum-nav-thread-wrapper {
273 274
  display: inline-block;
  vertical-align: middle;
Greg Price committed
275 276
}

277
.forum-nav-thread-wrapper-0 {
278 279 280
  @extend %forum-nav-thread-wrapper;

  @include margin-right($baseline/5);
281

282
  align-self: flex-start;
Omar Al-Ithawi committed
283

284 285 286 287
  .icon {
    font-size: $forum-base-font-size;
    width: 18px;
    text-align: center;
288

289 290 291 292
    &::before {
      @include rtl {
        @include transform(scale(-1, 1)); // RTL for font awesome question mark
      }
Omar Al-Ithawi committed
293
    }
294
  }
295 296
}

Greg Price committed
297
.forum-nav-thread-wrapper-1 {
298 299 300 301 302
  @extend %forum-nav-thread-wrapper;

  margin: 0 ($baseline / 4);
  // 125 is the width we need to save for the "X new" comments indicator - and we want to clip the preview
  // at the same length whether there are unread comments for this story or not.
303
  max-width: calc(100% - 75px);
304
  flex-grow: 1;  // This column should consume all the available space
Greg Price committed
305 306 307
}

.forum-nav-thread-wrapper-2 {
308 309 310 311
  @extend %forum-nav-thread-wrapper;

  @include text-align(right);

312
  min-width: 40px;
313
  white-space: nowrap;
Greg Price committed
314 315 316
}

.forum-nav-thread-title {
317 318 319 320
  @include margin-left(0);

  font-size: $forum-base-font-size;
  display: block;
Greg Price committed
321 322 323
}

%forum-nav-thread-wrapper-2-content {
324
  @include margin-right($baseline/4);
Greg Price committed
325

326 327 328 329 330 331 332 333
  font-size: $forum-small-font-size;
  display: inline-block;
  text-align: center;
  color: $black;

  &:last-child {
    @include margin-right(0);
  }
Greg Price committed
334 335 336
}

.forum-nav-thread-votes-count {
337
  @extend %forum-nav-thread-wrapper-2-content;
Greg Price committed
338 339 340
}

.forum-nav-thread-comments-count {
341 342 343 344 345 346 347 348 349 350 351
  @extend %forum-nav-thread-wrapper-2-content;
  @extend %t-weight4;

  position: relative;

  @include margin-left($baseline/4);

  margin-bottom: ($baseline/4); // Because tail is position: absolute
  border-radius: $forum-border-radius;
  padding: ($baseline/10) ($baseline/5);
  min-width: 2em; // Fit most comment counts but allow expansion if necessary
352
  background-color: theme-color("light");
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367

  // Speech bubble tail
  &::after {
    content: '';
    display: block;
    position: absolute;
    bottom: (-$baseline/4);

    @include right($baseline/4);

    width: 0;
    height: 0;
    border-style: solid;

    @include border-width(0, ($baseline/4), ($baseline/4), 0);
368
    @include border-color(transparent, $forum-color-border, transparent, transparent);
369
  }
Greg Price committed
370 371
}

Greg Price committed
372
.forum-nav-load-more {
373
  border-bottom: 1px solid $forum-color-border;
374
  background-color: theme-color("light");
Greg Price committed
375 376
}

Greg Price committed
377
%forum-nav-load-more-content {
378 379 380
  display: block;
  padding: $baseline 0;
  text-align: center;
Greg Price committed
381 382 383
}

.forum-nav-load-more-link {
384
  @extend %forum-nav-load-more-content;
Greg Price committed
385

386 387 388 389 390 391 392 393 394 395
  color: $link-color;
  width: 100%;

  &:hover,
  &:focus {
    color: $forum-color-active-text;
    // !important overrides the one set here:
    // https://github.com/edx/edx-platform/blob/master/lms/static/sass/elements/_controls.scss#L472
    background-color: $forum-color-active-thread !important;
  }
Greg Price committed
396 397 398
}

.forum-nav-loading {
399
  @extend %forum-nav-load-more-content;
Greg Price committed
400
}