dropdowns.scss 18.5 KB
Newer Older
Phil Hughes's avatar
Phil Hughes committed
1 2
.dropdown {
  position: relative;
3

4 5 6 7 8 9 10 11
  // Once the new design (https://gitlab.com/gitlab-org/gitlab-foss/-/issues/63499/designs)
  // for Snippets is introduced and Clone button is relocated, we won't
  // need this style.
  // Issue for the refactoring: https://gitlab.com/gitlab-org/gitlab/-/issues/213327
  &.gl-new-dropdown button.dropdown-toggle {
    @include gl-display-inline-flex;
  }

12 13 14 15 16
  .btn-link {
    &:hover {
      cursor: pointer;
    }
  }
17
}
Phil Hughes's avatar
Phil Hughes committed
18

19 20 21 22 23 24
@mixin chevron-active {
  .fa-chevron-down {
    color: $gray-darkest;
  }
}

25 26
@mixin set-visible {
  transform: translateY(0);
27
  display: block;
28 29 30 31
}

@mixin set-invisible {
  transform: translateY(-10px);
32
  display: none;
33 34
}

Clement Ho's avatar
Clement Ho committed
35
.show.dropdown {
Phil Hughes's avatar
Phil Hughes committed
36 37
  .dropdown-menu,
  .dropdown-menu-nav {
38
    @include set-visible;
39 40
    min-height: $dropdown-min-height;
    max-height: $dropdown-max-height;
41
    overflow-y: auto;
42

43 44 45 46
    &.dropdown-extended-height {
      max-height: 400px;
    }

Clement Ho's avatar
Clement Ho committed
47
    @include media-breakpoint-down(xs) {
48 49
      width: 100%;
    }
50

51
    &.frequent-items-dropdown-menu {
52 53 54 55
      padding: 0;
      overflow-y: initial;
      max-height: initial;
    }
Phil Hughes's avatar
Phil Hughes committed
56
  }
57

58
  .dropdown-toggle,
59
  .dropdown-menu-toggle {
60
    @include chevron-active;
61
    border-color: $gray-darkest;
62
  }
63

64
  [data-toggle='dropdown'] {
65 66
    outline: 0;
  }
67 68
}

69 70 71 72 73
// Get search dropdown to line up with other nav dropdowns
.search-input-container .dropdown-menu {
  margin-top: 11px;
}

Phil Hughes's avatar
Phil Hughes committed
74 75
.dropdown-toggle,
.confidential-merge-request-fork-group .dropdown-toggle {
76
  padding: 6px 8px 6px 10px;
77
  background-color: $white;
78
  color: $gl-text-color;
79
  font-size: 14px;
80
  text-align: left;
81
  border: 1px solid $border-color;
Phil Hughes's avatar
Phil Hughes committed
82
  border-radius: $border-radius-base;
83 84
  white-space: nowrap;

85 86 87 88
  &:disabled.read-only {
    color: $gl-text-color !important;
  }

89 90 91 92
  &.no-outline {
    outline: 0;
  }

93 94 95
  &.large {
    width: 200px;
  }
96 97 98 99 100 101 102 103

  &.wide {
    width: 100%;

    + .dropdown-select {
      width: 100%;
    }
  }
104 105 106 107 108 109 110 111 112

  // 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;
  }
113

114 115 116 117
  .fa {
    color: $gray-darkest;
  }

118 119 120
  .fa-chevron-down {
    font-size: $dropdown-chevron-size;
    position: relative;
121
    top: -2px;
122 123 124 125
    margin-left: 5px;
  }

  &:hover {
126
    @include chevron-active;
127
    border-color: $gray-darkest;
128 129 130
  }

  &:focus:active {
131
    @include chevron-active;
132
    border-color: $dropdown-toggle-active-border-color;
133
    outline: 0;
134 135 136 137 138
  }
}

.dropdown-menu-toggle {
  @extend .dropdown-toggle;
139
  padding-right: 25px;
140
  position: relative;
141
  width: 160px;
142 143 144 145 146 147 148 149
  text-overflow: ellipsis;
  overflow: hidden;

  .fa {
    position: absolute;

    &.fa-spinner {
      font-size: 16px;
150
      margin-top: -3px;
151 152 153
    }
  }

154 155
  .fa-chevron-down,
  .fa-spinner {
156 157 158 159
    position: absolute;
    top: 11px;
    right: 8px;
  }
160

161 162 163 164 165 166
  .spinner {
    position: absolute;
    top: 9px;
    right: 8px;
  }

167 168 169 170 171 172
  .ic-chevron-down {
    position: absolute;
    top: $gl-padding-8;
    right: $gl-padding-8;
    color: $gray-darkest;
  }
Phil Hughes's avatar
Phil Hughes committed
173 174
}

175
.gl-dropdown .dropdown-menu-toggle {
176
  padding-right: $gl-padding-8;
177

178 179
  .gl-dropdown-toggle-text {
    min-height: $gl-line-height-20;
180 181 182
  }
}

183
@mixin dropdown-item-hover {
184
  background-color: $gray-darker;
185
  color: $gl-text-color;
186
  outline: 0;
187

188
  // make sure the text color is not overridden
189 190 191
  &.text-danger {
    color: $brand-danger;
  }
192 193

  .avatar {
194
    border-color: $white;
195
  }
196 197
}

198
@mixin dropdown-link {
199 200 201 202
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
203
  display: block;
204
  font-weight: $gl-font-weight-normal;
205
  position: relative;
206
  padding: $dropdown-item-padding-y $dropdown-item-padding-x;
207
  color: $gl-text-color;
208
  line-height: $gl-btn-line-height;
209
  white-space: normal;
210
  overflow: hidden;
211 212
  text-align: left;
  width: 100%;
213

214
  // make sure the text color is not overridden
215 216 217 218
  &.text-danger {
    color: $brand-danger;
  }

219 220 221 222 223
  &.disable-hover {
    text-decoration: none;
  }

  &:not(.disable-hover):hover,
224
  &:active,
225 226
  &:focus,
  &.is-focused {
227 228
    @include dropdown-item-hover;

229 230
    text-decoration: none;

Clement Ho's avatar
Clement Ho committed
231
    .badge.badge-pill {
232
      background-color: darken($blue-50, 5%);
233 234 235 236 237
    }
  }

  &.dropdown-menu-user-link {
    line-height: 16px;
238 239 240 241 242 243 244
    padding-top: 10px;
    padding-bottom: 7px;
    white-space: nowrap;

    .dropdown-menu-user-username {
      display: block;
    }
245 246 247 248 249 250 251 252 253 254
  }

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

Phil Hughes's avatar
Phil Hughes committed
255 256
.dropdown-menu,
.dropdown-menu-nav {
Clement Ho's avatar
Clement Ho committed
257
  display: none;
Phil Hughes's avatar
Phil Hughes committed
258
  position: absolute;
259
  width: auto;
Phil Hughes's avatar
Phil Hughes committed
260
  top: 100%;
261
  z-index: 300;
262
  min-width: 240px;
263
  max-width: 500px;
Winnie Hellmann's avatar
Winnie Hellmann committed
264
  margin-top: $dropdown-vertical-offset;
265
  margin-bottom: 24px;
266
  font-size: 14px;
267
  font-weight: $gl-font-weight-normal;
268
  padding: 8px 0;
269
  background-color: $white;
270
  border: 1px solid $border-color;
Phil Hughes's avatar
Phil Hughes committed
271
  border-radius: $border-radius-base;
Phil Hughes's avatar
Phil Hughes committed
272
  box-shadow: 0 2px 4px $dropdown-shadow-color;
273

274 275 276 277
  &.dropdown-open-top {
    margin-bottom: $dropdown-vertical-offset;
  }

278 279 280 281 282
  &.dropdown-open-left {
    right: 0;
    left: auto;
  }

Phil Hughes's avatar
Phil Hughes committed
283 284 285 286 287 288 289 290 291 292
  &.is-loading {
    .dropdown-content {
      display: none;
    }

    .dropdown-loading {
      display: block;
    }
  }

293
  .shortcut-mappings {
294 295 296
    display: none;
  }

297
  &.shortcuts .shortcut-mappings {
298
    display: inline-block;
299
    margin-right: 5px;
300 301
  }

Phil Hughes's avatar
Phil Hughes committed
302 303 304 305 306
  ul {
    margin: 0;
    padding: 0;
  }

Phil Hughes's avatar
Phil Hughes committed
307
  li {
308
    display: block;
Phil Hughes's avatar
Phil Hughes committed
309 310
    text-align: left;
    list-style: none;
311
    padding: 0 1px;
312

313
    > a,
Phil Hughes's avatar
Phil Hughes committed
314
    button,
315 316 317
    .menu-item {
      @include dropdown-link;
    }
Phil Hughes's avatar
Phil Hughes committed
318 319 320
  }

  .divider {
321
    height: 1px;
322
    margin: #{$grid-size / 2} 0;
323
    padding: 0;
324
    background-color: $dropdown-divider-bg;
325 326

    &:hover {
327
      background-color: $dropdown-divider-bg;
328
    }
329 330 331
  }

  .separator {
Phil Hughes's avatar
Phil Hughes committed
332 333 334 335
    width: 100%;
    height: 1px;
    margin-top: 8px;
    margin-bottom: 8px;
336
    background-color: $dropdown-divider-bg;
Phil Hughes's avatar
Phil Hughes committed
337 338
  }

339 340 341 342 343 344 345
  .dropdown-menu-empty-item a {
    &:hover,
    &:focus {
      background-color: transparent;
    }
  }

346
  .dropdown-header {
347
    color: $black;
348
    font-size: 13px;
349
    font-weight: $gl-font-weight-bold;
350 351
    line-height: $gl-line-height;
    padding: $dropdown-item-padding-y $dropdown-item-padding-x;
352 353
  }

Clement Ho's avatar
Clement Ho committed
354 355 356 357
  &.capitalize-header .dropdown-header {
    text-transform: capitalize;
  }

Tim Zallmann's avatar
Tim Zallmann committed
358
  .dropdown-bold-header {
359
    font-weight: $gl-font-weight-bold;
360 361
    line-height: $gl-line-height;
    padding: $dropdown-item-padding-y $dropdown-item-padding-x;
362
  }
363 364 365 366

  .unclickable {
    cursor: not-allowed;
    padding: 5px 8px;
367
    color: $gl-text-color-secondary;
368
  }
369

Clement Ho's avatar
Clement Ho committed
370
  .badge.badge-pill + span:not(.badge.badge-pill) {
371 372 373
    // Expects up to 3 digits on the badge
    margin-right: 40px;
  }
374 375 376 377

  .dropdown-menu-content {
    padding: $dropdown-item-padding-y $dropdown-item-padding-x;
  }
Phil Hughes's avatar
Phil Hughes committed
378 379
}

380 381 382 383
.dropdown-item {
  @include dropdown-link;
}

384 385 386 387 388
.droplab-dropdown {
  .dropdown-toggle > i {
    pointer-events: none;
  }

389
  .dropdown-menu li {
390
    cursor: pointer;
391

392 393 394 395
    &.droplab-item-active button {
      @include dropdown-item-hover;
    }

396 397
    > a,
    > button {
398
      display: flex;
399 400
      margin: 0;
      text-overflow: inherit;
401
      text-align: left;
402

403 404 405
      &.btn .fa:not(:last-child) {
        margin-left: 5px;
      }
406 407
    }

Rajat Jain's avatar
Rajat Jain committed
408 409 410 411 412 413 414 415 416
    > button.dropdown-epic-button {
      flex-direction: column;

      .reference {
        color: $gl-gray-400;
        margin-top: $gl-padding-4;
      }
    }

417 418 419 420
    &.droplab-item-selected i {
      visibility: visible;
    }

421
    .icon {
422 423
      visibility: hidden;
    }
424 425 426 427 428 429 430 431 432 433

    .description {
      display: inline-block;
      white-space: normal;
      margin-left: 5px;

      p {
        margin-bottom: 0;
      }
    }
434 435
  }

436
  .icon {
437 438 439 440 441 442 443 444
    display: inline-block;
    vertical-align: top;
    padding-top: 2px;
  }
}

.droplab-dropdown .dropdown-menu,
.droplab-dropdown .dropdown-menu-nav {
445 446 447 448 449 450
  display: none;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

451
.comment-type-dropdown.show .dropdown-menu {
452 453 454
  display: block;
}

455 456 457 458 459 460 461
.filtered-search-box-input-container {
  .dropdown-menu,
  .dropdown-menu-nav {
    max-width: 280px;
  }
}

Phil Hughes's avatar
Phil Hughes committed
462 463 464 465 466
.dropdown-menu-drop-up {
  top: auto;
  bottom: 100%;
}

467 468 469 470 471 472 473 474 475 476
.dropdown-menu-large {
  width: 340px;
}

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

Phil Hughes's avatar
Phil Hughes committed
477 478 479 480
.dropdown-menu-full-width {
  width: 100%;
}

Phil Hughes's avatar
Phil Hughes committed
481
.dropdown-menu-paging {
482 483
  .dropdown-page-two,
  .dropdown-menu-back {
Phil Hughes's avatar
Phil Hughes committed
484 485 486 487 488 489 490 491
    display: none;
  }

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

492 493
    .dropdown-page-two,
    .dropdown-menu-back {
Phil Hughes's avatar
Phil Hughes committed
494 495
      display: block;
    }
496 497 498 499

    .dropdown-content {
      padding: 0 10px;
    }
Phil Hughes's avatar
Phil Hughes committed
500 501 502 503 504 505
  }
}

.dropdown-menu-user {
  .avatar {
    float: left;
506 507
    width: 2 * $gl-padding;
    height: 2 * $gl-padding;
Phil Hughes's avatar
Phil Hughes committed
508 509 510 511 512 513
    margin: 0 10px 0 0;
  }
}

.dropdown-menu-user-full-name {
  display: block;
514
  font-weight: $gl-font-weight-normal;
515
  line-height: 16px;
Phil Hughes's avatar
Phil Hughes committed
516 517 518 519 520 521 522
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-menu-user-username {
  display: block;
523
  line-height: 16px;
Phil Hughes's avatar
Phil Hughes committed
524 525 526 527 528 529
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-select {
530
  width: $dropdown-width;
531

Clement Ho's avatar
Clement Ho committed
532
  @include media-breakpoint-down(sm) {
533 534
    width: 100%;
  }
Phil Hughes's avatar
Phil Hughes committed
535 536
}

Phil Hughes's avatar
Phil Hughes committed
537
.dropdown-menu-selectable {
538
  li {
haseeb's avatar
haseeb committed
539
    a,
540 541
    button,
    .dropdown-item {
542 543
      padding: 8px 40px;
      position: relative;
Phil Hughes's avatar
Phil Hughes committed
544

545 546 547
      &.is-indeterminate,
      &.is-active {
        color: $gl-text-color;
548 549

        &::before {
550 551 552 553 554 555 556 557 558 559 560
          position: absolute;
          left: 16px;
          top: 16px;
          transform: translateY(-50%);
          font: normal normal normal 14px/1 FontAwesome;
          font-size: inherit;
          text-rendering: auto;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }

561 562
        &.dropdown-menu-user-link::before {
          top: 50%;
563 564
        }
      }
Alfredo Sumaran's avatar
Alfredo Sumaran committed
565

566
      &.is-indeterminate::before {
567
        content: '\f068';
568
      }
Alfredo Sumaran's avatar
Alfredo Sumaran committed
569

570
      &.is-active::before {
571
        content: '\f00c';
572
      }
Alfredo Sumaran's avatar
Alfredo Sumaran committed
573
    }
Phil Hughes's avatar
Phil Hughes committed
574 575 576
  }
}

Phil Hughes's avatar
Phil Hughes committed
577 578
.dropdown-title {
  position: relative;
579 580 581
  padding: $dropdown-item-padding-y $dropdown-item-padding-x;
  padding-bottom: #{2 * $dropdown-item-padding-y};
  margin-bottom: $dropdown-item-padding-y;
582
  font-weight: $gl-font-weight-bold;
Phil Hughes's avatar
Phil Hughes committed
583 584 585 586
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
587
  border-bottom: 1px solid $dropdown-divider-bg;
Phil Hughes's avatar
Phil Hughes committed
588 589 590 591 592
  overflow: hidden;
}

.dropdown-title-button {
  position: absolute;
593
  top: 0;
Phil Hughes's avatar
Phil Hughes committed
594
  padding: 0;
Phil Hughes's avatar
Phil Hughes committed
595
  color: $dropdown-title-btn-color;
Phil Hughes's avatar
Phil Hughes committed
596 597 598
  font-size: 14px;
  border: 0;
  background: none;
599
  outline: 0;
Phil Hughes's avatar
Phil Hughes committed
600 601

  &:hover {
Phil Hughes's avatar
Phil Hughes committed
602
    color: darken($dropdown-title-btn-color, 15%);
Phil Hughes's avatar
Phil Hughes committed
603 604 605 606
  }
}

.dropdown-menu-close {
607 608
  top: $gl-padding-4;
  right: $gl-padding-8;
609 610
  width: 20px;
  height: 20px;
Phil Hughes's avatar
Phil Hughes committed
611 612
}

613 614 615 616
.dropdown-menu-close-icon {
  vertical-align: middle;
}

Phil Hughes's avatar
Phil Hughes committed
617
.dropdown-menu-back {
618 619
  left: 7px;
  top: 2px;
Phil Hughes's avatar
Phil Hughes committed
620 621 622 623 624
}

.dropdown-input {
  position: relative;
  margin-bottom: 10px;
625
  padding: 0 10px;
Phil Hughes's avatar
Phil Hughes committed
626

627
  .fa,
628 629
  .input-icon,
  .ic-search {
Phil Hughes's avatar
Phil Hughes committed
630
    position: absolute;
631
    top: $gl-padding-8;
632
    right: 20px;
633
    color: $dropdown-input-fa-color;
Phil Hughes's avatar
Phil Hughes committed
634 635 636
    font-size: 12px;
    pointer-events: none;
  }
637 638 639 640 641

  .dropdown-input-clear {
    display: none;
    cursor: pointer;
    pointer-events: all;
642 643 644
    right: 22px;
    top: 9px;
    font-size: 14px;
645 646 647 648 649 650 651 652 653 654 655
  }

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

    .dropdown-input-search {
      display: none;
    }
  }
Phil Hughes's avatar
Phil Hughes committed
656 657
}

658 659
.dropdown-input-field,
.default-dropdown-input {
Simon Knox's avatar
Simon Knox committed
660
  background-color: $input-bg;
Phil Hughes's avatar
Phil Hughes committed
661
  display: block;
Phil Hughes's avatar
Phil Hughes committed
662
  width: 100%;
663
  min-height: 30px;
Phil Hughes's avatar
Phil Hughes committed
664
  padding: 0 7px;
665
  color: $gl-gray-700;
Phil Hughes's avatar
Phil Hughes committed
666
  line-height: 30px;
667
  border: 1px solid $dropdown-divider-bg;
Phil Hughes's avatar
Phil Hughes committed
668 669 670 671
  border-radius: 2px;
  outline: 0;

  &:focus {
672
    color: $gl-gray-700;
673
    border-color: $blue-300;
Phil Hughes's avatar
Phil Hughes committed
674
    box-shadow: 0 0 4px $dropdown-input-focus-shadow;
Phil Hughes's avatar
Phil Hughes committed
675

676
    ~ .fa {
677
      color: $gl-gray-700;
Phil Hughes's avatar
Phil Hughes committed
678 679 680 681
    }
  }

  &:hover {
682
    ~ .fa {
683
      color: $gl-gray-700;
Phil Hughes's avatar
Phil Hughes committed
684 685 686 687 688
    }
  }
}

.dropdown-content {
689
  max-height: 252px;
690
  overflow-y: auto;
Phil Hughes's avatar
Phil Hughes committed
691 692
}

693 694 695 696 697
.dropdown-info-note {
  color: $gl-text-color-secondary;
  text-align: center;
}

Phil Hughes's avatar
Phil Hughes committed
698 699 700 701
.dropdown-footer {
  padding-top: 10px;
  margin-top: 10px;
  font-size: 13px;
702
  border-top: 1px solid $dropdown-divider-bg;
Phil Hughes's avatar
Phil Hughes committed
703 704
}

705 706 707 708 709
.dropdown-footer-content {
  padding-left: 10px;
  padding-right: 10px;
}

710 711 712 713 714 715 716
.dropdown-due-date-footer {
  padding-top: 0;
  margin-left: 10px;
  margin-right: 10px;
  border-top: 0;
}

717 718 719 720
.dropdown-footer-list {
  font-size: 14px;

  a {
721
    cursor: pointer;
722 723 724 725
    padding-left: 10px;
  }
}

726 727 728 729 730 731 732 733 734 735
.dropdown-create-new-item-button {
  @include dropdown-link;

  width: 100%;
  background-color: transparent;
  border: 0;
  text-align: left;
  text-overflow: ellipsis;
}

Phil Hughes's avatar
Phil Hughes committed
736 737 738 739 740 741 742 743
.dropdown-loading {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  z-index: 9;
Phil Hughes's avatar
Phil Hughes committed
744
  background-color: $dropdown-loading-bg;
Phil Hughes's avatar
Phil Hughes committed
745 746 747 748 749 750 751 752 753 754
  font-size: 28px;

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

756 757 758
.dropdown-label-box {
  position: relative;
  top: 3px;
759
  margin-right: 5px;
760
  display: inline-block;
761 762 763
  width: 15px;
  height: 15px;
  border-radius: $border-radius-base;
764
}
765

766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789
.git-revision-dropdown {
  .dropdown-content {
    max-height: 215px;
  }
}

.sidebar-move-issue-dropdown {
  .dropdown-content {
    max-height: 160px;
  }
}

.dropdown-menu-author {
  .dropdown-content {
    max-height: 215px;
  }
}

.dropdown-menu-labels {
  .dropdown-content {
    max-height: 128px;
  }
}

790
.dropdown-menu-due-date {
791 792 793 794
  .dropdown-content {
    max-height: 230px;
  }

Phil Hughes's avatar
Phil Hughes committed
795
  .pika-single {
796 797
    position: relative !important;
    top: 0 !important;
Phil Hughes's avatar
Phil Hughes committed
798 799
    border: 0;
    box-shadow: none;
800 801
  }

Phil Hughes's avatar
Phil Hughes committed
802 803 804
  .pika-lendar {
    margin-top: -5px;
    margin-bottom: 0;
805 806
  }
}
807 808 809

.dropdown-menu-inner-title {
  display: block;
810
  color: $gl-text-color;
811
  font-weight: $gl-font-weight-bold;
812 813 814 815
}

.dropdown-menu-inner-content {
  display: block;
816
  color: $gl-text-color-secondary;
817
}
818 819 820

.dropdown-toggle-text {
  &.is-default {
821
    color: $gl-text-color-secondary;
822 823
  }
}
824

825 826 827 828 829 830 831 832 833 834 835 836 837 838 839
.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;

840 841 842 843
  &.is-hidden {
    @include set-invisible;
    overflow: hidden;
  }
844
}
845

Clement Ho's avatar
Clement Ho committed
846
@include media-breakpoint-down(xs) {
847
  .navbar-gitlab {
848
    li.dropdown {
849 850 851 852 853 854 855 856 857 858 859
      position: static;
    }
  }

  header.navbar-gitlab .dropdown {
    .dropdown-menu,
    .dropdown-menu-nav {
      width: 100%;
      min-width: 100%;
    }
  }
860 861 862 863 864 865 866

  header.navbar-gitlab-new .header-content .dropdown {
    .dropdown-menu {
      left: 0;
      min-width: 100%;
    }
  }
867 868
}

869
header.header-content .dropdown-menu.frequent-items-dropdown-menu {
870 871 872
  padding: 0;
}

873
.frequent-items-dropdown-container {
874 875 876
  display: flex;
  flex-direction: row;
  width: 500px;
877
  height: 354px;
878

879 880
  .frequent-items-dropdown-sidebar,
  .frequent-items-dropdown-content {
881 882 883 884 885 886 887
    padding: 8px 0;
  }

  .loading-animation {
    color: $almost-black;
  }

888
  .frequent-items-dropdown-sidebar {
889 890 891 892
    width: 30%;
    border-right: 1px solid $border-color;
  }

893
  .frequent-items-dropdown-content {
894 895 896 897
    position: relative;
    width: 70%;
  }

Clement Ho's avatar
Clement Ho committed
898
  @include media-breakpoint-down(xs) {
899 900 901 902 903
    flex-direction: column;
    width: 100%;
    height: auto;
    flex: 1;

904 905
    .frequent-items-dropdown-sidebar,
    .frequent-items-dropdown-content {
906 907 908
      width: 100%;
    }

909
    .frequent-items-dropdown-sidebar {
910 911 912 913 914
      border-bottom: 1px solid $border-color;
      border-right: 0;
    }
  }

915 916 917 918 919 920 921 922
  .section-header,
  .frequent-items-list-container li.section-empty {
    padding: 0 $gl-padding;
    color: $gl-text-color-secondary;
    font-size: $gl-font-size;
  }

  .frequent-items-list-container {
923
    height: 304px;
924 925
    padding: 8px 0;
    overflow-y: auto;
Phil Hughes's avatar
Phil Hughes committed
926 927

    li.section-empty.section-failure {
928
      color: $red-700;
Phil Hughes's avatar
Phil Hughes committed
929
    }
930

931 932 933
    .frequent-items-list-item-container a {
      display: flex;
    }
934 935 936 937 938 939 940 941 942 943
  }

  .search-input-container {
    position: relative;
    padding: 4px $gl-padding;

    .search-icon {
      position: absolute;
      top: 13px;
      right: 25px;
944
      color: $gray-50;
945 946 947 948 949 950 951 952
    }
  }

  .section-header {
    font-weight: 700;
    margin-top: 8px;
  }

Clement Ho's avatar
Clement Ho committed
953
  @include media-breakpoint-down(xs) {
954
    .frequent-items-list-container {
955 956 957 958 959 960 961
      width: auto;
      height: auto;
      padding-bottom: 0;
    }
  }
}

962 963 964
.frequent-items-list-item-container {
  .frequent-items-item-avatar-container,
  .frequent-items-item-metadata-container {
965 966 967
    float: left;
  }

968 969 970 971 972 973 974 975
  .frequent-items-item-metadata-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .frequent-items-item-title,
  .frequent-items-item-namespace {
976 977
    max-width: 250px;
    text-overflow: ellipsis;
978
    white-space: nowrap;
979 980 981
  }

  &:hover {
982
    .frequent-items-item-avatar-container .avatar {
983
      border-color: $gray-50;
984 985 986
    }
  }

987
  .frequent-items-item-title {
988 989 990 991 992
    font-size: $gl-font-size;
    font-weight: 400;
    line-height: 16px;
  }

993
  .frequent-items-item-namespace {
994 995 996 997 998 999
    margin-top: 4px;
    font-size: 12px;
    line-height: 12px;
    color: $gl-text-color-secondary;
  }

Clement Ho's avatar
Clement Ho committed
1000
  @include media-breakpoint-down(xs) {
1001
    .frequent-items-item-metadata-container {
1002 1003 1004 1005
      float: none;
    }
  }
}
1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020

.dropdown-content-faded-mask {
  position: relative;

  .dropdown-list {
    max-height: $dropdown-max-height;
    overflow-y: auto;
    position: relative;
  }

  &::after {
    height: $dropdown-fade-mask-height;
    width: 100%;
    position: absolute;
    bottom: 0;
1021
    background: linear-gradient(to top, $white 0, rgba($white, 0));
1022 1023 1024 1025 1026 1027 1028 1029 1030
    transition: opacity $fade-mask-transition-duration $fade-mask-transition-curve;
    content: '';
    pointer-events: none;
  }

  &.fade-out::after {
    opacity: 0;
  }
}
Kushal Pandya's avatar
Kushal Pandya committed
1031 1032

.labels-select-wrapper {
1033 1034 1035 1036 1037 1038 1039 1040 1041 1042
  &.is-standalone {
    .labels-select-dropdown-contents {
      max-height: 350px;

      .dropdown-content {
        height: 250px;
      }
    }
  }

Kushal Pandya's avatar
Kushal Pandya committed
1043 1044 1045
  .labels-select-dropdown-contents {
    min-height: $dropdown-min-height;
    max-height: 330px;
1046
    background-color: $white;
Kushal Pandya's avatar
Kushal Pandya committed
1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059
    border: 1px solid $border-color;
    box-shadow: 0 2px 4px $dropdown-shadow-color;
    z-index: 2;

    .dropdown-content {
      height: 135px;
    }
  }

  .labels-fetch-loading {
    top: 0;
    left: 0;
    opacity: 0.5;
1060
    background-color: $white;
Kushal Pandya's avatar
Kushal Pandya committed
1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091
    z-index: 1;
  }

  .dropdown-header-button {
    .gl-icon {
      color: $dropdown-title-btn-color;

      &:hover {
        color: $gl-gray-400;
      }
    }
  }

  .label-item {
    padding: 8px 20px;

    &:hover,
    &.is-focused {
      @include dropdown-item-hover;

      text-decoration: none;
    }
  }

  .color-input-container {
    .dropdown-label-color-preview {
      border: 1px solid $gray-200;
      border-right: 0;
    }
  }
}