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

4 5
.forum-nav {
  @include box-sizing(border-box);
6
  @include float(left);
7
  position: relative;
Greg Price committed
8
  width: 31%;
9 10 11 12 13 14 15 16 17 18 19
  border: 1px solid #aaa;
  border-radius: 3px;
}

// ------
// Header
// ------
.forum-nav-header {
  @include box-sizing(border-box);
  display: table;
  border-bottom: 1px solid $gray-l2;
Greg Price committed
20
  width: 100%;
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
  background-color: $gray-l3;
}

.forum-nav-browse {
  @include box-sizing(border-box);
  display: table-cell;
  vertical-align: middle;
  width: 50%;
  padding: ($baseline/4);

  &:hover, &:focus, &.is-active {
    background-color: $gray-l5;
  }

  .icon {
36
    @include font-size(14);
37
    @include margin-right($baseline/4);
38 39 40 41 42 43 44 45
  }
}

.forum-nav-browse-current {
  @include font-size(12);
}

.forum-nav-browse-drop-arrow {
46
  @include margin-left($baseline/4);
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
}

.forum-nav-search {
  @include box-sizing(border-box);
  display: table-cell;
  position: relative;
  vertical-align: middle;
  width: 50%;
  padding: ($baseline/4);
}

.forum-nav-search .icon {
  @include font-size(12);
  position: absolute;
  margin-top: -6px;
  top: 50%;
63
  @include right($baseline/4 + 1px + $baseline / 4); // Wrapper padding + border + input padding
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
}

.forum-nav-search-input {
  width: 100%;
}

// -----------
// Browse menu
// -----------
.forum-nav-browse-menu-wrapper {
  border-bottom: 1px solid $gray-l3;
  background: $gray-l5;
}

.forum-nav-browse-filter {
  position: relative;
  border-bottom: 1px solid $gray-l2;
  padding: ($baseline/4);
}

.forum-nav-browse-filter .icon {
  @include font-size(12);
  position: absolute;
  margin-top: -6px;
  top: 50%;
  right: ($baseline/4 + 1px + $baseline / 4); // Wrapper padding + border + input padding
}

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

96
.forum-nav-browse-menu {
97
  @include font-size(14);
98
  overflow-y: scroll;
99 100 101 102
  list-style: none;
}

.forum-nav-browse-submenu {
Greg Price committed
103
  padding-left: $baseline;
104 105 106 107 108
  list-style: none;
}

.forum-nav-browse-title {
  display: block;
Greg Price committed
109 110 111 112 113 114
  border-bottom: 1px solid $gray-l3;
  padding: ($baseline/2) ($baseline/2);

  &:hover, &:focus {
    background: $forum-color-active-thread;
  }
115 116
}

117
.forum-nav-browse-title .icon {
118
  @include margin-right($baseline/2);
119 120
}

121 122 123 124 125 126 127 128 129 130
// -------------------
// Sort and filter bar
// -------------------
.forum-nav-refine-bar {
  @include clearfix();
  @include font-size(11);
  border-bottom: 1px solid $gray-l3;
  background-color: $gray-l5;
  padding: ($baseline/4) ($baseline/2);
  color: $black;
131 132 133 134 135 136 137
  text-align: right;
}

.forum-nav-filter-main {
  @include box-sizing(border-box);
  display: inline-block;
  width: 50%;
138
  @include text-align(left);
139 140 141 142 143 144
}

.forum-nav-filter-cohort, .forum-nav-sort {
  @include box-sizing(border-box);
  display: inline-block;
  width: 50%;
145
  @include text-align(right);
146 147 148 149 150 151 152 153
}

%forum-nav-select {
  border: none;
  max-width: 100%;
  background-color: transparent;
}

154
.forum-nav-filter-main-control {
155 156 157
  @extend %forum-nav-select;
}

158 159
.forum-nav-filter-cohort-control {
  @extend %forum-nav-select;
160 161 162 163 164 165
}

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

Greg Price committed
166 167 168 169 170
// -----------
// Thread list
// -----------
.forum-nav-thread-list {
  overflow-y: scroll;
171
  list-style: none;
Greg Price committed
172 173 174
}

.forum-nav-thread {
175 176
  border-bottom: 1px solid $gray-l4;
  background-color: $gray-l6;
Greg Price committed
177 178

  &.is-unread {
179 180 181 182 183 184 185 186 187

    .forum-nav-thread-comments-count {
      background-color: $blue-d1;
      color: $white;

      &:after {
        border-right-color: $blue-d1;
      }
    }
Greg Price committed
188
  }
Greg Price committed
189 190 191
}

.forum-nav-thread-link {
192
  display: block;
Greg Price committed
193 194
  padding: ($baseline/4) ($baseline/2);

195 196 197
  &.is-active,
  &:hover,
  &:focus {
Greg Price committed
198 199
    background-color: $forum-color-active-thread;
  }
200 201 202 203 204 205 206 207 208 209 210 211 212

  &.is-active {
    color: $base-font-color;

    .forum-nav-thread-comments-count {
      background-color: $gray-l4;
      color: $base-font-color;

      &:after {
        border-right-color: $gray-l4;
      }
    }
  }
Greg Price committed
213 214 215 216 217 218 219
}

%forum-nav-thread-wrapper {
  display: inline-block;
  vertical-align: middle;
}

220 221 222 223 224 225
.forum-nav-thread-wrapper-0 {
  @extend %forum-nav-thread-wrapper;
  width: 7%;

  .icon {
    @include font-size(14);
Omar Al-Ithawi committed
226 227

    &:before {
228 229 230 231

      @include rtl {
        @include transform(scale(-1, 1)); // RTL for font awesome question mark
      }
Omar Al-Ithawi committed
232
    }
233 234
  }

235
  .fa-comments {
236 237 238
    color: $gray-l2;
  }

239
  .fa-check-square-o {
240 241 242
    color: $forum-color-marked-answer;
  }

243
  .fa-question {
244 245 246 247
    color: $pink;
  }
}

Greg Price committed
248 249
.forum-nav-thread-wrapper-1 {
  @extend %forum-nav-thread-wrapper;
250
  width: 80%;
Greg Price committed
251 252 253 254
}

.forum-nav-thread-wrapper-2 {
  @extend %forum-nav-thread-wrapper;
255
  width: 13%;
256
  @include text-align(right);
Greg Price committed
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
}

.forum-nav-thread-title {
  @extend %t-title7;
  display: block;
}

%forum-nav-thread-wrapper-2-content {
  @include font-size(11);
  display: inline-block;
  margin-right: ($baseline/4);
  text-align: center;
  color: $black;

  &:last-child {
    margin-right: 0;
  }
}

.forum-nav-thread-votes-count {
  @extend %forum-nav-thread-wrapper-2-content;
}

.forum-nav-thread-comments-count {
  @extend %forum-nav-thread-wrapper-2-content;
  @extend %t-weight4;
  position: relative;
284
  @include margin-left($baseline/4);
Greg Price committed
285 286 287 288
  margin-bottom: ($baseline/4); // Because tail is position: absolute
  border-radius: 2px;
  padding: ($baseline/10) ($baseline/5);
  min-width: 2em; // Fit most comment counts but allow expansion if necessary
289
  background-color: $gray-l4;
Greg Price committed
290 291 292 293 294 295 296

  // Speech bubble tail
  &:after {
    content: '';
    display: block;
    position: absolute;
    bottom: (-$baseline/4);
297
    @include right($baseline/4);
Greg Price committed
298 299 300
    width: 0;
    height: 0;
    border-style: solid;
301
    @include border-width(0, ($baseline/4), ($baseline/4), 0);
302
    @include border-color(transparent, $gray-l4, transparent, transparent);
Greg Price committed
303 304 305
  }
}

Greg Price committed
306 307 308 309 310
.forum-nav-load-more {
  border-bottom: 1px solid $gray-l3;
  background-color: $gray-l5;
}

Greg Price committed
311
%forum-nav-load-more-content {
312
  display: block;
Greg Price committed
313
  padding: $baseline 0;
Greg Price committed
314 315 316 317 318 319
  text-align: center;
}

.forum-nav-load-more-link {
  @extend %forum-nav-load-more-content;
  color: $link-color;
Greg Price committed
320

321 322
  &:hover,
  &:focus {
Greg Price committed
323 324 325
    color: $link-color;
    background-color: $forum-color-active-thread;
  }
Greg Price committed
326 327 328 329 330
}

.forum-nav-loading {
  @extend %forum-nav-load-more-content;
}