BigW Consortium Gitlab

dropdowns.scss 10.4 KB
Newer Older
Phil Hughes committed
1 2
.dropdown {
  position: relative;
3 4 5 6 7 8

  .btn-link {
    &:hover {
      cursor: pointer;
    }
  }
9
}
Phil Hughes committed
10

11 12
@mixin chevron-active {
  .fa-chevron-down {
13
    color: $gray-darkest;
14 15 16
  }
}

17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
@mixin set-visible {
  transform: translateY(0);
  visibility: visible;
  opacity: 1;
  transition-duration: 100ms, 150ms, 25ms;
  transition-delay: 35ms, 50ms, 25ms;
}

@mixin set-invisible {
  transform: translateY(-10px);
  visibility: hidden;
  opacity: 0;
  transition-property: opacity, transform, visibility;
  transition-duration: 70ms, 250ms, 250ms;
  transition-timing-function: linear, $dropdown-animation-timing;
  transition-delay: 25ms, 50ms, 0ms;
}

35
.open {
36 37
  .dropdown-menu,
  .dropdown-menu-nav {
38
    display: block;
39
    @include set-visible;
40

41 42 43
    @media (max-width: $screen-xs-max) {
      width: 100%;
    }
Phil Hughes committed
44
  }
45

46
  .dropdown-toggle,
47
  .dropdown-menu-toggle {
48
    @include chevron-active;
49
    border-color: $gray-darkest;
50 51 52
  }
}

53 54
.dropdown-toggle {
  padding: 6px 8px 6px 10px;
55
  background-color: $white-light;
56
  color: $gl-text-color;
57
  font-size: 14px;
58
  text-align: left;
59
  border: 1px solid $border-color;
Phil Hughes committed
60
  border-radius: $border-radius-base;
61 62
  white-space: nowrap;

63
  &[disabled] {
64
    opacity: .65;
65 66 67
    cursor: not-allowed;
  }

68 69 70 71
  &.no-outline {
    outline: 0;
  }

72 73 74
  &.large {
    width: 200px;
  }
75 76 77 78 79 80 81 82

  &.wide {
    width: 100%;

    + .dropdown-select {
      width: 100%;
    }
  }
83 84 85 86 87 88 89 90 91

  // Allows dynamic-width text in the dropdown toggle.
  // Resizes to allow long text without overflowing the container.
  &.dynamic {
    width: auto;
    min-width: 160px;
    max-width: 100%;
    padding-right: 25px;
  }
92 93

  .fa {
94
    color: $gray-darkest;
95 96 97 98 99
  }

  .fa-chevron-down {
    font-size: $dropdown-chevron-size;
    position: relative;
100
    top: -2px;
101 102 103 104
    margin-left: 5px;
  }

  &:hover {
105
    @include chevron-active;
106
    border-color: $gray-darkest;
107 108 109
  }

  &:focus:active {
110
    @include chevron-active;
111 112 113 114 115 116
    border-color: $dropdown-toggle-active-border-color;
  }
}

.dropdown-menu-toggle {
  @extend .dropdown-toggle;
117
  padding-right: 25px;
118
  position: relative;
119
  width: 163px;
120 121 122 123 124 125 126 127
  text-overflow: ellipsis;
  overflow: hidden;

  .fa {
    position: absolute;

    &.fa-spinner {
      font-size: 16px;
128
      margin-top: -3px;
129 130 131
    }
  }

132 133
  .fa-chevron-down,
  .fa-spinner {
134 135 136 137
    position: absolute;
    top: 11px;
    right: 8px;
  }
Phil Hughes committed
138 139
}

140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
@mixin dropdown-link {
  display: block;
  position: relative;
  padding: 5px 8px;
  color: $gl-text-color;
  line-height: initial;
  text-overflow: ellipsis;
  border-radius: 2px;
  white-space: nowrap;
  overflow: hidden;

  &:hover,
  &:focus,
  &.is-focused {
    background-color: $dropdown-link-hover-bg;
    text-decoration: none;

    .badge {
      background-color: darken($dropdown-link-hover-bg, 5%);
    }
  }

  &.dropdown-menu-empty-link {
    &.is-focused {
      background-color: $dropdown-empty-row-bg;
    }
  }

  &.dropdown-menu-user-link {
    line-height: 16px;
  }

  .icon-play {
    fill: $gl-text-color-secondary;
    margin-right: 6px;
    height: 12px;
    width: 11px;
  }
}

180 181
.dropdown-menu,
.dropdown-menu-nav {
182
  display: block;
Phil Hughes committed
183
  position: absolute;
184
  width: 100%;
Phil Hughes committed
185 186
  top: 100%;
  left: 0;
187
  z-index: 9;
188
  min-width: 240px;
Phil Hughes committed
189
  margin-top: 2px;
190
  margin-bottom: 0;
191
  font-size: 14px;
192
  font-weight: normal;
193
  padding: 8px 0;
194
  background-color: $white-light;
Phil Hughes committed
195
  border: 1px solid $dropdown-border-color;
Phil Hughes committed
196
  border-radius: $border-radius-base;
Phil Hughes committed
197
  box-shadow: 0 2px 4px $dropdown-shadow-color;
198 199 200 201 202
  @include set-invisible;

  @media (max-width: $screen-sm-min) {
    width: 100%;
  }
Phil Hughes committed
203

204 205 206 207 208 209 210 211 212 213
  &.is-loading {
    .dropdown-content {
      display: none;
    }

    .dropdown-loading {
      display: block;
    }
  }

214
  .shortcut-mappings {
215 216 217
    display: none;
  }

218
  &.shortcuts .shortcut-mappings {
219
    display: inline-block;
220
    margin-right: 5px;
221 222
  }

223 224 225 226 227
  ul {
    margin: 0;
    padding: 0;
  }

Phil Hughes committed
228 229 230
  li {
    text-align: left;
    list-style: none;
231
    padding: 0 10px;
Phil Hughes committed
232 233 234
  }

  .divider {
235
    height: 1px;
236
    margin: 6px 10px;
237 238 239 240 241
    padding: 0;
    background-color: $dropdown-divider-color;
  }

  .separator {
Phil Hughes committed
242 243 244 245 246 247 248 249
    width: 100%;
    height: 1px;
    margin-top: 8px;
    margin-bottom: 8px;
    background-color: $dropdown-divider-color;
  }

  a {
250
    @include dropdown-link;
Phil Hughes committed
251
  }
252 253

  .dropdown-header {
254
    color: $gl-text-color-secondary;
255 256
    font-size: 13px;
    line-height: 22px;
257
    padding: 0 16px;
258 259
  }

Clement Ho committed
260 261 262 263
  &.capitalize-header .dropdown-header {
    text-transform: capitalize;
  }

264 265 266
  .separator + .dropdown-header {
    padding-top: 2px;
  }
267 268 269 270

  .unclickable {
    cursor: not-allowed;
    padding: 5px 8px;
271
    color: $gl-text-color-secondary;
272
  }
273 274 275 276 277 278

  .badge {
    position: absolute;
    right: 8px;
    top: 5px;
  }
Phil Hughes committed
279 280
}

281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297
.filtered-search-box-input-container .dropdown-menu,
.filtered-search-box-input-container .dropdown-menu-nav,
.comment-type-dropdown .dropdown-menu {
  display: none;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.filtered-search-box-input-container {
  .dropdown-menu,
  .dropdown-menu-nav {
    max-width: 280px;
    width: auto;
  }
}

Phil Hughes committed
298 299 300 301 302
.dropdown-menu-drop-up {
  top: auto;
  bottom: 100%;
}

303 304 305 306 307 308 309 310 311 312
.dropdown-menu-large {
  width: 340px;
}

.dropdown-menu-no-wrap {
  a {
    white-space: normal;
  }
}

Phil Hughes committed
313 314 315 316
.dropdown-menu-full-width {
  width: 100%;
}

317
.dropdown-menu-paging {
318 319
  .dropdown-page-two,
  .dropdown-menu-back {
320 321 322 323 324 325 326 327
    display: none;
  }

  &.is-page-two {
    .dropdown-page-one {
      display: none;
    }

328 329
    .dropdown-page-two,
    .dropdown-menu-back {
330 331
      display: block;
    }
332 333 334 335

    .dropdown-content {
      padding: 0 10px;
    }
336 337 338 339 340 341
  }
}

.dropdown-menu-user {
  .avatar {
    float: left;
342 343
    width: 2 * $gl-padding;
    height: 2 * $gl-padding;
344 345 346 347 348
    margin: 0 10px 0 0;
  }
}

.dropdown-menu-user-link {
Jacob Schatz committed
349
  padding-top: 10px;
350 351 352 353 354
  padding-bottom: 7px;
}

.dropdown-menu-user-full-name {
  display: block;
Jacob Schatz committed
355
  font-weight: 500;
356
  line-height: 16px;
357 358 359 360 361 362 363
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-menu-user-username {
  display: block;
364
  line-height: 16px;
365 366 367 368 369 370
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-select {
371
  width: $dropdown-width;
372 373 374 375

  @media (max-width: $screen-sm-min) {
    width: 100%;
  }
376 377
}

Phil Hughes committed
378 379 380 381 382 383 384
.dropdown-menu-align-right {
  left: auto;
  right: 0;
}

.dropdown-menu-selectable {
  a {
385
    padding-left: 26px;
386
    position: relative;
Phil Hughes committed
387

388 389
    &.is-indeterminate,
    &.is-active {
390 391 392
      font-weight: 600;
      color: $gl-text-color;

Phil Hughes committed
393 394
      &::before {
        position: absolute;
395
        left: 6px;
396 397
        top: 50%;
        transform: translateY(-50%);
Phil Hughes committed
398 399 400 401 402 403 404
        font: normal normal normal 14px/1 FontAwesome;
        font-size: inherit;
        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
      }
    }
405

406
    &.is-indeterminate::before {
407 408 409 410 411
      content: "\f068";
    }

    &.is-active::before {
      content: "\f00c";
412 413 414
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
415
    }
Phil Hughes committed
416 417 418
  }
}

419 420 421

.dropdown-title {
  position: relative;
422
  padding: 2px 25px 10px;
423
  margin: 0 10px 10px;
424 425 426 427 428 429 430 431 432 433 434
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 1px solid $dropdown-divider-color;
  overflow: hidden;
}

.dropdown-title-button {
  position: absolute;
435
  top: 0;
436
  padding: 0;
Phil Hughes committed
437
  color: $dropdown-title-btn-color;
438 439 440
  font-size: 14px;
  border: 0;
  background: none;
441
  outline: 0;
442 443

  &:hover {
Phil Hughes committed
444
    color: darken($dropdown-title-btn-color, 15%);
445 446 447 448
  }
}

.dropdown-menu-close {
449
  right: 5px;
450 451
  width: 20px;
  height: 20px;
452
  top: -1px;
453 454 455
}

.dropdown-menu-back {
456 457
  left: 7px;
  top: 2px;
458 459 460 461 462
}

.dropdown-input {
  position: relative;
  margin-bottom: 10px;
463
  padding: 0 10px;
464 465 466 467

  .fa {
    position: absolute;
    top: 10px;
468
    right: 20px;
469
    color: $dropdown-input-fa-color;
470 471 472
    font-size: 12px;
    pointer-events: none;
  }
473 474 475 476 477

  .dropdown-input-clear {
    display: none;
    cursor: pointer;
    pointer-events: all;
478 479 480
    right: 22px;
    top: 9px;
    font-size: 14px;
481 482 483 484 485 486 487 488 489 490 491
  }

  &.has-value {
    .dropdown-input-clear {
      display: block;
    }

    .dropdown-input-search {
      display: none;
    }
  }
492 493
}

494 495
.dropdown-input-field,
.default-dropdown-input {
496
  width: 100%;
497
  min-height: 30px;
498
  padding: 0 7px;
Phil Hughes committed
499
  color: $dropdown-input-color;
500 501 502 503 504 505 506
  line-height: 30px;
  border: 1px solid $dropdown-divider-color;
  border-radius: 2px;
  outline: 0;

  &:focus {
    color: $dropdown-link-color;
Phil Hughes committed
507 508
    border-color: $dropdown-input-focus-border;
    box-shadow: 0 0 4px $dropdown-input-focus-shadow;
509

510
    ~ .fa {
511 512 513 514 515
      color: $dropdown-link-color;
    }
  }

  &:hover {
516
    ~ .fa {
517 518 519 520 521 522
      color: $dropdown-link-color;
    }
  }
}

.dropdown-content {
523
  max-height: 215px;
524
  overflow-y: auto;
525 526
}

527 528 529 530 531
.dropdown-info-note {
  color: $gl-text-color-secondary;
  text-align: center;
}

532 533 534 535 536 537 538
.dropdown-footer {
  padding-top: 10px;
  margin-top: 10px;
  font-size: 13px;
  border-top: 1px solid $dropdown-divider-color;
}

539 540 541 542 543 544 545
.dropdown-due-date-footer {
  padding-top: 0;
  margin-left: 10px;
  margin-right: 10px;
  border-top: 0;
}

546 547 548 549
.dropdown-footer-list {
  font-size: 14px;

  a {
550
    cursor: pointer;
551 552 553 554
    padding-left: 10px;
  }
}

555 556 557 558 559 560 561 562
.dropdown-loading {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  z-index: 9;
Phil Hughes committed
563
  background-color: $dropdown-loading-bg;
564 565 566 567 568 569 570 571 572 573
  font-size: 28px;

  .fa {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -14px;
    margin-left: -14px;
  }
}
574

575 576 577
.dropdown-label-box {
  position: relative;
  top: 3px;
578
  margin-right: 5px;
579
  display: inline-block;
580 581 582
  width: 15px;
  height: 15px;
  border-radius: $border-radius-base;
583
}
584 585

.dropdown-menu-due-date {
586 587 588 589
  .dropdown-content {
    max-height: 230px;
  }

590 591 592 593 594
  .pika-single {
    position: relative!important;
    top: 0!important;
    border: 0;
    box-shadow: none;
595 596
  }

597 598 599
  .pika-lendar {
    margin-top: -5px;
    margin-bottom: 0;
600 601
  }
}
602 603 604

.dropdown-menu-inner-title {
  display: block;
605
  color: $gl-text-color;
606 607 608 609 610
  font-weight: 600;
}

.dropdown-menu-inner-content {
  display: block;
611
  color: $gl-text-color-secondary;
612
}
613 614 615

.dropdown-toggle-text {
  &.is-default {
616
    color: $gl-text-color-secondary;
617 618
  }
}
619 620 621 622

.droplab-item-ignore {
  pointer-events: none;
}
623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643

.pika-single.animate-picker.is-bound,
.pika-single.animate-picker.is-bound.is-hidden {
  /*
   * Having `!important` is not recommended but
   * since `pikaday` sets positioning inline
   * there's no way it can be gracefully overridden
   * using config options.
   */
  position: absolute !important;
  display: block;
}

.pika-single.animate-picker.is-bound {
  @include set-visible;
}

.pika-single.animate-picker.is-bound.is-hidden {
  @include set-invisible;
  overflow: hidden;
}