dropdowns.scss 11.7 KB
Newer Older
P
Phil Hughes 已提交
1 2
.dropdown {
  position: relative;
3 4 5 6 7 8

  .btn-link {
    &:hover {
      cursor: pointer;
    }
  }
9
}
P
Phil Hughes 已提交
10

11 12
@mixin chevron-active {
  .fa-chevron-down {
A
Annabel Dunstone Gray 已提交
13
    color: $gray-darkest;
14 15 16
  }
}

N
Nur Rony 已提交
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 {
P
Phil Hughes 已提交
36 37
  .dropdown-menu,
  .dropdown-menu-nav {
N
Nur Rony 已提交
38
    @include set-visible;
39
    display: block;
40

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

46
  .dropdown-toggle,
P
Phil Hughes 已提交
47
  .dropdown-menu-toggle {
48
    @include chevron-active;
A
Annabel Dunstone Gray 已提交
49
    border-color: $gray-darkest;
P
Phil Hughes 已提交
50
  }
51 52 53 54

  [data-toggle="dropdown"] {
    outline: 0;
  }
P
Phil Hughes 已提交
55 56
}

D
David Wagner 已提交
57 58
.dropdown-toggle {
  padding: 6px 8px 6px 10px;
A
Annabel Dunstone Gray 已提交
59
  background-color: $white-light;
60
  color: $gl-text-color;
61
  font-size: 14px;
P
Phil Hughes 已提交
62
  text-align: left;
63
  border: 1px solid $border-color;
P
Phil Hughes 已提交
64
  border-radius: $border-radius-base;
P
Phil Hughes 已提交
65 66
  white-space: nowrap;

P
Phil Hughes 已提交
67
  &[disabled] {
68
    opacity: .65;
P
Phil Hughes 已提交
69 70 71
    cursor: not-allowed;
  }

72 73 74 75
  &.no-outline {
    outline: 0;
  }

76 77 78
  &.large {
    width: 200px;
  }
79 80 81 82 83 84 85 86

  &.wide {
    width: 100%;

    + .dropdown-select {
      width: 100%;
    }
  }
87 88 89 90 91 92 93 94 95

  // 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;
  }
D
David Wagner 已提交
96 97

  .fa {
A
Annabel Dunstone Gray 已提交
98
    color: $gray-darkest;
D
David Wagner 已提交
99 100 101 102 103
  }

  .fa-chevron-down {
    font-size: $dropdown-chevron-size;
    position: relative;
104
    top: -2px;
D
David Wagner 已提交
105 106 107 108
    margin-left: 5px;
  }

  &:hover {
109
    @include chevron-active;
A
Annabel Dunstone Gray 已提交
110
    border-color: $gray-darkest;
D
David Wagner 已提交
111 112 113
  }

  &:focus:active {
114
    @include chevron-active;
D
David Wagner 已提交
115
    border-color: $dropdown-toggle-active-border-color;
116
    outline: 0;
D
David Wagner 已提交
117 118 119 120 121
  }
}

.dropdown-menu-toggle {
  @extend .dropdown-toggle;
J
Jarkko Tuunanen 已提交
122
  padding-right: 25px;
D
David Wagner 已提交
123
  position: relative;
D
Dimitrie Hoekstra 已提交
124
  width: 163px;
D
David Wagner 已提交
125 126 127 128 129 130 131 132
  text-overflow: ellipsis;
  overflow: hidden;

  .fa {
    position: absolute;

    &.fa-spinner {
      font-size: 16px;
133
      margin-top: -3px;
D
David Wagner 已提交
134 135 136
    }
  }

137 138
  .fa-chevron-down,
  .fa-spinner {
D
David Wagner 已提交
139 140 141 142
    position: absolute;
    top: 11px;
    right: 8px;
  }
P
Phil Hughes 已提交
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 180 181 182 183 184
@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;
  }
}

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

  @media (max-width: $screen-sm-min) {
    width: 100%;
  }
P
Phil Hughes 已提交
208

209 210 211 212 213
  &.dropdown-open-left {
    right: 0;
    left: auto;
  }

P
Phil Hughes 已提交
214 215 216 217 218 219 220 221 222 223
  &.is-loading {
    .dropdown-content {
      display: none;
    }

    .dropdown-loading {
      display: block;
    }
  }

224
  .shortcut-mappings {
225 226 227
    display: none;
  }

228
  &.shortcuts .shortcut-mappings {
229
    display: inline-block;
230
    margin-right: 5px;
231 232
  }

P
Phil Hughes 已提交
233 234 235 236 237
  ul {
    margin: 0;
    padding: 0;
  }

P
Phil Hughes 已提交
238 239 240
  li {
    text-align: left;
    list-style: none;
D
dimitrieh 已提交
241
    padding: 0 10px;
P
Phil Hughes 已提交
242 243 244
  }

  .divider {
245
    height: 1px;
D
dimitrieh 已提交
246
    margin: 6px 10px;
247 248 249 250 251
    padding: 0;
    background-color: $dropdown-divider-color;
  }

  .separator {
P
Phil Hughes 已提交
252 253 254 255 256 257 258 259
    width: 100%;
    height: 1px;
    margin-top: 8px;
    margin-bottom: 8px;
    background-color: $dropdown-divider-color;
  }

  a {
260
    @include dropdown-link;
P
Phil Hughes 已提交
261
  }
262 263

  .dropdown-header {
264
    color: $gl-text-color-secondary;
265 266
    font-size: 13px;
    line-height: 22px;
D
dimitrieh 已提交
267
    padding: 0 16px;
268 269
  }

C
Clement Ho 已提交
270 271 272 273
  &.capitalize-header .dropdown-header {
    text-transform: capitalize;
  }

T
Tim Zallmann 已提交
274 275 276 277 278 279
  .dropdown-bold-header {
    font-weight: 600;
    line-height: 22px;
    padding: 0 16px;
  }

T
Tim Zallmann 已提交
280
  .separator + .dropdown-header,
T
Tim Zallmann 已提交
281
  .separator + .dropdown-bold-header {
282 283
    padding-top: 2px;
  }
284 285 286 287

  .unclickable {
    cursor: not-allowed;
    padding: 5px 8px;
T
tauriedavis 已提交
288
    color: $gl-text-color-secondary;
289
  }
290 291 292 293 294 295

  .badge {
    position: absolute;
    right: 8px;
    top: 5px;
  }
P
Phil Hughes 已提交
296 297
}

298 299 300 301
.droplab-dropdown {
  .description {
    display: inline-block;
    white-space: normal;
L
Luke "Jared" Bennett 已提交
302
    margin-left: 5px;
303 304 305 306 307 308 309
  }

  .dropdown-toggle > i {
    pointer-events: none;
  }

  li {
L
Luke "Jared" Bennett 已提交
310
    padding: $gl-btn-padding $gl-btn-padding 2px;
311
    cursor: pointer;
312

L
Luke "Jared" Bennett 已提交
313 314
    > a,
    > button {
L
Luke "Jared" Bennett 已提交
315
      display: flex;
316 317 318 319
      margin: 0;
      padding: 0;
      border-radius: 0;
      text-overflow: inherit;
L
Luke "Jared" Bennett 已提交
320 321 322 323
      background-color: inherit;
      color: inherit;
      border: inherit;
      text-align: left;
324 325 326 327 328 329

      &:hover,
      &:focus {
        background-color: inherit;
        color: inherit;
      }
L
Luke "Jared" Bennett 已提交
330 331 332 333

      &.btn .fa:not(:last-child) {
        margin-left: 5px;
      }
334 335 336 337 338 339 340 341 342 343 344 345
    }

    &:hover,
    &:focus {
      background-color: $dropdown-hover-color;
      color: $white-light;
    }

    &.droplab-item-selected i {
      visibility: visible;
    }

L
Luke "Jared" Bennett 已提交
346
    .icon {
347 348 349 350
      visibility: hidden;
    }
  }

L
Luke "Jared" Bennett 已提交
351
  .icon {
352 353 354 355 356 357 358 359 360 361 362 363 364 365
    display: inline-block;
    vertical-align: top;
    padding-top: 2px;
  }

  .divider {
    margin: 0 8px;
    padding: 0;
    border-top: $gray-darkest;
  }
}

.droplab-dropdown .dropdown-menu,
.droplab-dropdown .dropdown-menu-nav {
N
Nur Rony 已提交
366 367 368 369 370 371 372 373 374 375 376 377 378 379
  display: none;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

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

P
Phil Hughes 已提交
380 381 382 383 384
.dropdown-menu-drop-up {
  top: auto;
  bottom: 100%;
}

385 386 387 388 389 390 391 392 393 394
.dropdown-menu-large {
  width: 340px;
}

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

P
Phil Hughes 已提交
395 396 397 398
.dropdown-menu-full-width {
  width: 100%;
}

P
Phil Hughes 已提交
399
.dropdown-menu-paging {
400 401
  .dropdown-page-two,
  .dropdown-menu-back {
P
Phil Hughes 已提交
402 403 404 405 406 407 408 409
    display: none;
  }

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

410 411
    .dropdown-page-two,
    .dropdown-menu-back {
P
Phil Hughes 已提交
412 413
      display: block;
    }
414 415 416 417

    .dropdown-content {
      padding: 0 10px;
    }
P
Phil Hughes 已提交
418 419 420 421 422 423
  }
}

.dropdown-menu-user {
  .avatar {
    float: left;
424 425
    width: 2 * $gl-padding;
    height: 2 * $gl-padding;
P
Phil Hughes 已提交
426 427 428 429 430
    margin: 0 10px 0 0;
  }
}

.dropdown-menu-user-link {
J
Jacob Schatz 已提交
431
  padding-top: 10px;
P
Phil Hughes 已提交
432 433 434 435 436
  padding-bottom: 7px;
}

.dropdown-menu-user-full-name {
  display: block;
J
Jacob Schatz 已提交
437
  font-weight: 500;
438
  line-height: 16px;
P
Phil Hughes 已提交
439 440 441 442 443 444 445
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-menu-user-username {
  display: block;
446
  line-height: 16px;
P
Phil Hughes 已提交
447 448 449 450 451 452
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-select {
453
  width: $dropdown-width;
N
Nur Rony 已提交
454 455 456 457

  @media (max-width: $screen-sm-min) {
    width: 100%;
  }
P
Phil Hughes 已提交
458 459
}

P
Phil Hughes 已提交
460 461 462
.dropdown-menu-align-right {
  left: auto;
  right: 0;
463 464 465 466 467
  margin-top: -5px;

  @media (max-width: $screen-xs-max) {
    left: 0;
  }
P
Phil Hughes 已提交
468 469 470 471
}

.dropdown-menu-selectable {
  a {
D
dimitrieh 已提交
472
    padding-left: 26px;
473
    position: relative;
P
Phil Hughes 已提交
474

475 476
    &.is-indeterminate,
    &.is-active {
D
dimitrieh 已提交
477 478 479
      font-weight: 600;
      color: $gl-text-color;

P
Phil Hughes 已提交
480 481
      &::before {
        position: absolute;
D
dimitrieh 已提交
482
        left: 6px;
483 484
        top: 50%;
        transform: translateY(-50%);
P
Phil Hughes 已提交
485 486 487 488 489 490 491
        font: normal normal normal 14px/1 FontAwesome;
        font-size: inherit;
        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
      }
    }
A
Alfredo Sumaran 已提交
492

493
    &.is-indeterminate::before {
A
Alfredo Sumaran 已提交
494 495 496 497 498
      content: "\f068";
    }

    &.is-active::before {
      content: "\f00c";
499 500 501
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
A
Alfredo Sumaran 已提交
502
    }
P
Phil Hughes 已提交
503 504 505
  }
}

P
Phil Hughes 已提交
506 507 508

.dropdown-title {
  position: relative;
D
dimitrieh 已提交
509
  padding: 2px 25px 10px;
510
  margin: 0 10px 10px;
P
Phil Hughes 已提交
511 512 513 514 515 516 517 518 519 520 521
  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;
522
  top: 0;
P
Phil Hughes 已提交
523
  padding: 0;
P
Phil Hughes 已提交
524
  color: $dropdown-title-btn-color;
P
Phil Hughes 已提交
525 526 527
  font-size: 14px;
  border: 0;
  background: none;
P
Phil Hughes 已提交
528
  outline: 0;
P
Phil Hughes 已提交
529 530

  &:hover {
P
Phil Hughes 已提交
531
    color: darken($dropdown-title-btn-color, 15%);
P
Phil Hughes 已提交
532 533 534 535
  }
}

.dropdown-menu-close {
P
Phil Hughes 已提交
536
  right: 5px;
537 538
  width: 20px;
  height: 20px;
D
dimitrieh 已提交
539
  top: -1px;
P
Phil Hughes 已提交
540 541 542
}

.dropdown-menu-back {
543 544
  left: 7px;
  top: 2px;
P
Phil Hughes 已提交
545 546 547 548 549
}

.dropdown-input {
  position: relative;
  margin-bottom: 10px;
550
  padding: 0 10px;
P
Phil Hughes 已提交
551 552 553 554

  .fa {
    position: absolute;
    top: 10px;
555
    right: 20px;
S
Sam Rose 已提交
556
    color: $dropdown-input-fa-color;
P
Phil Hughes 已提交
557 558 559
    font-size: 12px;
    pointer-events: none;
  }
560 561 562 563 564

  .dropdown-input-clear {
    display: none;
    cursor: pointer;
    pointer-events: all;
565 566 567
    right: 22px;
    top: 9px;
    font-size: 14px;
568 569 570 571 572 573 574 575 576 577 578
  }

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

    .dropdown-input-search {
      display: none;
    }
  }
P
Phil Hughes 已提交
579 580
}

581 582
.dropdown-input-field,
.default-dropdown-input {
P
Phil Hughes 已提交
583
  width: 100%;
584
  min-height: 30px;
P
Phil Hughes 已提交
585
  padding: 0 7px;
P
Phil Hughes 已提交
586
  color: $dropdown-input-color;
P
Phil Hughes 已提交
587 588 589 590 591 592 593
  line-height: 30px;
  border: 1px solid $dropdown-divider-color;
  border-radius: 2px;
  outline: 0;

  &:focus {
    color: $dropdown-link-color;
P
Phil Hughes 已提交
594 595
    border-color: $dropdown-input-focus-border;
    box-shadow: 0 0 4px $dropdown-input-focus-shadow;
P
Phil Hughes 已提交
596

597
    ~ .fa {
P
Phil Hughes 已提交
598 599 600 601 602
      color: $dropdown-link-color;
    }
  }

  &:hover {
603
    ~ .fa {
P
Phil Hughes 已提交
604 605 606 607 608 609
      color: $dropdown-link-color;
    }
  }
}

.dropdown-content {
P
Phil Hughes 已提交
610
  max-height: 215px;
611
  overflow-y: auto;
P
Phil Hughes 已提交
612 613
}

E
Eric Eastwood 已提交
614 615 616 617 618
.dropdown-info-note {
  color: $gl-text-color-secondary;
  text-align: center;
}

P
Phil Hughes 已提交
619 620 621 622 623 624 625
.dropdown-footer {
  padding-top: 10px;
  margin-top: 10px;
  font-size: 13px;
  border-top: 1px solid $dropdown-divider-color;
}

P
Phil Hughes 已提交
626 627 628 629 630 631 632
.dropdown-due-date-footer {
  padding-top: 0;
  margin-left: 10px;
  margin-right: 10px;
  border-top: 0;
}

633 634 635 636
.dropdown-footer-list {
  font-size: 14px;

  a {
637
    cursor: pointer;
638 639 640 641
    padding-left: 10px;
  }
}

P
Phil Hughes 已提交
642 643 644 645 646 647 648 649
.dropdown-loading {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  z-index: 9;
P
Phil Hughes 已提交
650
  background-color: $dropdown-loading-bg;
P
Phil Hughes 已提交
651 652 653 654 655 656 657 658 659 660
  font-size: 28px;

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

P
Phil Hughes 已提交
662 663 664
.dropdown-label-box {
  position: relative;
  top: 3px;
665
  margin-right: 5px;
P
Phil Hughes 已提交
666
  display: inline-block;
667 668 669
  width: 15px;
  height: 15px;
  border-radius: $border-radius-base;
670
}
P
Phil Hughes 已提交
671 672

.dropdown-menu-due-date {
673 674 675 676
  .dropdown-content {
    max-height: 230px;
  }

P
Phil Hughes 已提交
677 678 679 680 681
  .pika-single {
    position: relative!important;
    top: 0!important;
    border: 0;
    box-shadow: none;
P
Phil Hughes 已提交
682 683
  }

P
Phil Hughes 已提交
684 685 686
  .pika-lendar {
    margin-top: -5px;
    margin-bottom: 0;
P
Phil Hughes 已提交
687 688
  }
}
689 690 691

.dropdown-menu-inner-title {
  display: block;
T
tauriedavis 已提交
692
  color: $gl-text-color;
693 694 695 696 697
  font-weight: 600;
}

.dropdown-menu-inner-content {
  display: block;
T
tauriedavis 已提交
698
  color: $gl-text-color-secondary;
699
}
P
Phil Hughes 已提交
700 701 702

.dropdown-toggle-text {
  &.is-default {
T
tauriedavis 已提交
703
    color: $gl-text-color-secondary;
P
Phil Hughes 已提交
704 705
  }
}
706 707 708 709

.droplab-item-ignore {
  pointer-events: none;
}
N
Nur Rony 已提交
710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730

.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;
}