dropdowns.scss 9.1 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
  }
}

17
.open {
P
Phil Hughes 已提交
18 19
  .dropdown-menu,
  .dropdown-menu-nav {
20
    display: block;
21

22 23
    @media (max-width: $screen-xs-max) {
      width: 100%;
24
      min-width: 240px;
25
    }
P
Phil Hughes 已提交
26
  }
P
Phil Hughes 已提交
27

28
  .dropdown-toggle,
P
Phil Hughes 已提交
29
  .dropdown-menu-toggle {
30
    @include chevron-active;
A
Annabel Dunstone Gray 已提交
31
    border-color: $gray-darkest;
P
Phil Hughes 已提交
32 33 34
  }
}

D
David Wagner 已提交
35 36
.dropdown-toggle {
  padding: 6px 8px 6px 10px;
A
Annabel Dunstone Gray 已提交
37
  background-color: $white-light;
38
  color: $gl-text-color;
39
  font-size: 14px;
P
Phil Hughes 已提交
40
  text-align: left;
41
  border: 1px solid $border-color;
P
Phil Hughes 已提交
42
  border-radius: $border-radius-base;
P
Phil Hughes 已提交
43 44
  white-space: nowrap;

P
Phil Hughes 已提交
45
  &[disabled] {
46
    opacity: .65;
P
Phil Hughes 已提交
47 48 49
    cursor: not-allowed;
  }

50 51 52 53
  &.no-outline {
    outline: 0;
  }

54 55 56
  &.large {
    width: 200px;
  }
57 58 59 60 61 62 63 64

  &.wide {
    width: 100%;

    + .dropdown-select {
      width: 100%;
    }
  }
65 66 67 68 69 70 71 72 73

  // 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 已提交
74 75

  .fa {
A
Annabel Dunstone Gray 已提交
76
    color: $gray-darkest;
D
David Wagner 已提交
77 78 79 80 81 82 83 84 85 86
  }

  .fa-chevron-down {
    font-size: $dropdown-chevron-size;
    position: relative;
    top: -3px;
    margin-left: 5px;
  }

  &:hover {
87
    @include chevron-active;
A
Annabel Dunstone Gray 已提交
88
    border-color: $gray-darkest;
D
David Wagner 已提交
89 90 91
  }

  &:focus:active {
92
    @include chevron-active;
D
David Wagner 已提交
93 94 95 96 97 98
    border-color: $dropdown-toggle-active-border-color;
  }
}

.dropdown-menu-toggle {
  @extend .dropdown-toggle;
J
Jarkko Tuunanen 已提交
99
  padding-right: 25px;
D
David Wagner 已提交
100
  position: relative;
D
Dimitrie Hoekstra 已提交
101
  width: 163px;
D
David Wagner 已提交
102 103 104 105 106 107 108 109
  text-overflow: ellipsis;
  overflow: hidden;

  .fa {
    position: absolute;

    &.fa-spinner {
      font-size: 16px;
110
      margin-top: -3px;
D
David Wagner 已提交
111 112 113
    }
  }

114 115
  .fa-chevron-down,
  .fa-spinner {
D
David Wagner 已提交
116 117 118 119
    position: absolute;
    top: 11px;
    right: 8px;
  }
P
Phil Hughes 已提交
120 121
}

122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
@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 已提交
162 163
.dropdown-menu,
.dropdown-menu-nav {
P
Phil Hughes 已提交
164 165 166 167
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
168
  z-index: 9;
169
  min-width: 240px;
P
Phil Hughes 已提交
170
  margin-top: 2px;
171
  margin-bottom: 0;
172
  font-size: 14px;
173
  font-weight: normal;
P
Phil Hughes 已提交
174
  padding: 8px 0;
175
  background-color: $white-light;
P
Phil Hughes 已提交
176
  border: 1px solid $dropdown-border-color;
P
Phil Hughes 已提交
177
  border-radius: $border-radius-base;
P
Phil Hughes 已提交
178 179
  box-shadow: 0 2px 4px $dropdown-shadow-color;

P
Phil Hughes 已提交
180 181 182 183 184 185 186 187 188 189
  &.is-loading {
    .dropdown-content {
      display: none;
    }

    .dropdown-loading {
      display: block;
    }
  }

190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
  .kbd {
    display: none;
  }

  &.shortcuts span{
    display: inline-block;
    width: 140px;
  }

  &.shortcuts .kbd {
    display: inline-block;
    padding: 3px 5px;
    font-size: 11px;
    line-height: 10px;
    color: #555;
    vertical-align: middle;
    background-color: #fcfcfc;
    border-width: 1px;
    border-style: solid;
    border-color: #ccc #ccc #bbb;
    border-image: none;
    border-radius: 3px;
    box-shadow: 0 -1px 0 #bbb inset;
    width: 21px;
    text-align: center;
  }

P
Phil Hughes 已提交
217 218 219 220 221
  ul {
    margin: 0;
    padding: 0;
  }

P
Phil Hughes 已提交
222 223 224
  li {
    text-align: left;
    list-style: none;
D
dimitrieh 已提交
225
    padding: 0 10px;
P
Phil Hughes 已提交
226 227 228
  }

  .divider {
229
    height: 1px;
D
dimitrieh 已提交
230
    margin: 6px 10px;
231 232 233 234 235
    padding: 0;
    background-color: $dropdown-divider-color;
  }

  .separator {
P
Phil Hughes 已提交
236 237 238 239 240 241 242 243
    width: 100%;
    height: 1px;
    margin-top: 8px;
    margin-bottom: 8px;
    background-color: $dropdown-divider-color;
  }

  a {
244
    @include dropdown-link;
P
Phil Hughes 已提交
245
  }
246 247

  .dropdown-header {
D
dimitrieh 已提交
248
    color: $gl-text-color;
249
    font-size: 13px;
D
dimitrieh 已提交
250
    font-weight: 600;
251
    line-height: 22px;
252
    text-transform: capitalize;
D
dimitrieh 已提交
253
    padding: 0 16px;
254 255 256 257 258
  }

  .separator + .dropdown-header {
    padding-top: 2px;
  }
259 260 261 262

  .unclickable {
    cursor: not-allowed;
    padding: 5px 8px;
T
tauriedavis 已提交
263
    color: $gl-text-color-secondary;
264
  }
265 266 267 268 269 270

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

P
Phil Hughes 已提交
273 274 275 276 277
.dropdown-menu-drop-up {
  top: auto;
  bottom: 100%;
}

278 279 280 281 282 283 284 285 286 287
.dropdown-menu-large {
  width: 340px;
}

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

P
Phil Hughes 已提交
288 289 290 291
.dropdown-menu-full-width {
  width: 100%;
}

P
Phil Hughes 已提交
292
.dropdown-menu-paging {
293 294
  .dropdown-page-two,
  .dropdown-menu-back {
P
Phil Hughes 已提交
295 296 297 298 299 300 301 302
    display: none;
  }

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

303 304
    .dropdown-page-two,
    .dropdown-menu-back {
P
Phil Hughes 已提交
305 306
      display: block;
    }
307 308 309 310

    .dropdown-content {
      padding: 0 10px;
    }
P
Phil Hughes 已提交
311 312 313 314 315 316 317 318 319 320 321 322 323
  }
}

.dropdown-menu-user {
  .avatar {
    float: left;
    width: 30px;
    height: 30px;
    margin: 0 10px 0 0;
  }
}

.dropdown-menu-user-link {
J
Jacob Schatz 已提交
324
  padding-top: 10px;
P
Phil Hughes 已提交
325 326 327 328 329
  padding-bottom: 7px;
}

.dropdown-menu-user-full-name {
  display: block;
J
Jacob Schatz 已提交
330
  font-weight: 500;
331
  line-height: 16px;
P
Phil Hughes 已提交
332 333 334 335 336 337 338
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-menu-user-username {
  display: block;
339
  line-height: 16px;
P
Phil Hughes 已提交
340 341 342 343 344 345
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-select {
346
  width: $dropdown-width;
P
Phil Hughes 已提交
347 348
}

P
Phil Hughes 已提交
349 350 351 352 353 354 355
.dropdown-menu-align-right {
  left: auto;
  right: 0;
}

.dropdown-menu-selectable {
  a {
D
dimitrieh 已提交
356
    padding-left: 26px;
P
Phil Hughes 已提交
357

358 359
    &.is-indeterminate,
    &.is-active {
D
dimitrieh 已提交
360 361 362
      font-weight: 600;
      color: $gl-text-color;

P
Phil Hughes 已提交
363 364
      &::before {
        position: absolute;
D
dimitrieh 已提交
365 366
        left: 6px;
        top: 6px;
P
Phil Hughes 已提交
367 368 369 370 371 372 373
        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 已提交
374

375
    &.is-indeterminate::before {
A
Alfredo Sumaran 已提交
376 377 378 379 380 381
      content: "\f068";
    }

    &.is-active::before {
      content: "\f00c";
    }
P
Phil Hughes 已提交
382 383 384
  }
}

P
Phil Hughes 已提交
385 386 387

.dropdown-title {
  position: relative;
D
dimitrieh 已提交
388
  padding: 2px 25px 10px;
389
  margin: 0 10px 10px;
P
Phil Hughes 已提交
390 391 392 393 394 395 396 397 398 399 400
  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;
401
  top: 0;
P
Phil Hughes 已提交
402
  padding: 0;
P
Phil Hughes 已提交
403
  color: $dropdown-title-btn-color;
P
Phil Hughes 已提交
404 405 406
  font-size: 14px;
  border: 0;
  background: none;
P
Phil Hughes 已提交
407
  outline: 0;
P
Phil Hughes 已提交
408 409

  &:hover {
P
Phil Hughes 已提交
410
    color: darken($dropdown-title-btn-color, 15%);
P
Phil Hughes 已提交
411 412 413 414
  }
}

.dropdown-menu-close {
P
Phil Hughes 已提交
415
  right: 5px;
416 417
  width: 20px;
  height: 20px;
D
dimitrieh 已提交
418
  top: -1px;
P
Phil Hughes 已提交
419 420 421
}

.dropdown-menu-back {
422 423
  left: 7px;
  top: 2px;
P
Phil Hughes 已提交
424 425 426 427 428
}

.dropdown-input {
  position: relative;
  margin-bottom: 10px;
429
  padding: 0 10px;
P
Phil Hughes 已提交
430 431 432 433

  .fa {
    position: absolute;
    top: 10px;
434
    right: 20px;
S
Sam Rose 已提交
435
    color: $dropdown-input-fa-color;
P
Phil Hughes 已提交
436 437 438
    font-size: 12px;
    pointer-events: none;
  }
439 440 441 442 443

  .dropdown-input-clear {
    display: none;
    cursor: pointer;
    pointer-events: all;
444 445 446
    right: 22px;
    top: 9px;
    font-size: 14px;
447 448 449 450 451 452 453 454 455 456 457
  }

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

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

460 461
.dropdown-input-field,
.default-dropdown-input {
P
Phil Hughes 已提交
462
  width: 100%;
463
  min-height: 30px;
P
Phil Hughes 已提交
464
  padding: 0 7px;
P
Phil Hughes 已提交
465
  color: $dropdown-input-color;
P
Phil Hughes 已提交
466 467 468 469 470 471 472
  line-height: 30px;
  border: 1px solid $dropdown-divider-color;
  border-radius: 2px;
  outline: 0;

  &:focus {
    color: $dropdown-link-color;
P
Phil Hughes 已提交
473 474
    border-color: $dropdown-input-focus-border;
    box-shadow: 0 0 4px $dropdown-input-focus-shadow;
P
Phil Hughes 已提交
475

476
    ~ .fa {
P
Phil Hughes 已提交
477 478 479 480 481
      color: $dropdown-link-color;
    }
  }

  &:hover {
482
    ~ .fa {
P
Phil Hughes 已提交
483 484 485 486 487 488
      color: $dropdown-link-color;
    }
  }
}

.dropdown-content {
P
Phil Hughes 已提交
489
  max-height: 215px;
490
  overflow-y: auto;
P
Phil Hughes 已提交
491 492
}

E
Eric Eastwood 已提交
493 494 495 496 497
.dropdown-info-note {
  color: $gl-text-color-secondary;
  text-align: center;
}

P
Phil Hughes 已提交
498 499 500 501 502 503 504
.dropdown-footer {
  padding-top: 10px;
  margin-top: 10px;
  font-size: 13px;
  border-top: 1px solid $dropdown-divider-color;
}

P
Phil Hughes 已提交
505 506 507 508 509 510 511
.dropdown-due-date-footer {
  padding-top: 0;
  margin-left: 10px;
  margin-right: 10px;
  border-top: 0;
}

512 513 514 515
.dropdown-footer-list {
  font-size: 14px;

  a {
516
    cursor: pointer;
517 518 519 520
    padding-left: 10px;
  }
}

P
Phil Hughes 已提交
521 522 523 524 525 526 527 528
.dropdown-loading {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  z-index: 9;
P
Phil Hughes 已提交
529
  background-color: $dropdown-loading-bg;
P
Phil Hughes 已提交
530 531 532 533 534 535 536 537 538 539
  font-size: 28px;

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

P
Phil Hughes 已提交
541 542 543
.dropdown-label-box {
  position: relative;
  top: 3px;
544
  margin-right: 5px;
P
Phil Hughes 已提交
545
  display: inline-block;
546 547 548
  width: 15px;
  height: 15px;
  border-radius: $border-radius-base;
549
}
P
Phil Hughes 已提交
550 551

.dropdown-menu-due-date {
552 553 554 555
  .dropdown-content {
    max-height: 230px;
  }

P
Phil Hughes 已提交
556 557 558 559 560
  .pika-single {
    position: relative!important;
    top: 0!important;
    border: 0;
    box-shadow: none;
P
Phil Hughes 已提交
561 562
  }

P
Phil Hughes 已提交
563 564 565
  .pika-lendar {
    margin-top: -5px;
    margin-bottom: 0;
P
Phil Hughes 已提交
566 567
  }
}
568 569 570

.dropdown-menu-inner-title {
  display: block;
T
tauriedavis 已提交
571
  color: $gl-text-color;
572 573 574 575 576
  font-weight: 600;
}

.dropdown-menu-inner-content {
  display: block;
T
tauriedavis 已提交
577
  color: $gl-text-color-secondary;
578
}
P
Phil Hughes 已提交
579 580 581

.dropdown-toggle-text {
  &.is-default {
T
tauriedavis 已提交
582
    color: $gl-text-color-secondary;
P
Phil Hughes 已提交
583 584
  }
}