dropdowns.scss 10.0 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;
P
Phil Hughes 已提交
37
  background-color: $dropdown-toggle-bg;
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 46 47 48 49
  &[disabled] {
    background-color: $input-bg-disabled;
    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 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
    border-color: $dropdown-toggle-active-border-color;
  }
}

.dropdown-menu-toggle {
  @extend .dropdown-toggle;
  padding-right: 20px;
  position: relative;
  width: 160px;
  text-overflow: ellipsis;
  overflow: hidden;

  .fa {
    position: absolute;

    &.fa-spinner {
      font-size: 16px;
      margin-top: -8px;
    }
  }

  .fa-chevron-down {
    position: absolute;
    top: 11px;
    right: 8px;
  }
P
Phil Hughes 已提交
119 120
}

P
Phil Hughes 已提交
121 122
.dropdown-menu,
.dropdown-menu-nav {
P
Phil Hughes 已提交
123 124 125 126
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
127
  z-index: 9;
P
Phil Hughes 已提交
128 129
  width: 240px;
  margin-top: 2px;
130
  margin-bottom: 0;
131
  font-size: 14px;
132
  font-weight: normal;
P
Phil Hughes 已提交
133
  padding: 8px 0;
134
  background-color: $white-light;
P
Phil Hughes 已提交
135
  border: 1px solid $dropdown-border-color;
P
Phil Hughes 已提交
136
  border-radius: $border-radius-base;
P
Phil Hughes 已提交
137 138
  box-shadow: 0 2px 4px $dropdown-shadow-color;

P
Phil Hughes 已提交
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
  &.is-loading {
    .dropdown-content {
      display: none;
    }

    .dropdown-loading {
      display: block;
    }
  }

  ul {
    margin: 0;
    padding: 0;
  }

P
Phil Hughes 已提交
154 155 156
  li {
    text-align: left;
    list-style: none;
P
Phil Hughes 已提交
157
    padding: 0 8px;
P
Phil Hughes 已提交
158 159 160
  }

  .divider {
161
    height: 1px;
P
Phil Hughes 已提交
162
    margin: 8px;
163 164 165 166 167
    padding: 0;
    background-color: $dropdown-divider-color;
  }

  .separator {
P
Phil Hughes 已提交
168 169 170 171 172 173 174 175 176 177
    width: 100%;
    height: 1px;
    margin-top: 8px;
    margin-bottom: 8px;
    background-color: $dropdown-divider-color;
  }

  a {
    display: block;
    position: relative;
P
Phil Hughes 已提交
178
    padding: 5px 8px;
P
Phil Hughes 已提交
179
    color: $dropdown-link-color;
P
Phil Hughes 已提交
180
    line-height: initial;
P
Phil Hughes 已提交
181 182 183 184 185
    text-overflow: ellipsis;
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;

P
Phil Hughes 已提交
186 187 188
    &:hover,
    &:focus,
    &.is-focused {
P
Phil Hughes 已提交
189 190
      background-color: $dropdown-link-hover-bg;
      text-decoration: none;
P
Phil Hughes 已提交
191
      outline: 0;
P
Phil Hughes 已提交
192
    }
193 194 195 196 197 198

    &.dropdown-menu-empty-link {
      &.is-focused {
        background-color: $dropdown-empty-row-bg;
      }
    }
A
Alfredo Sumaran 已提交
199 200 201 202

    &.dropdown-menu-user-link {
      line-height: 16px;
    }
C
Clement Ho 已提交
203 204

    .icon-play {
205
      fill: $gl-gray-light;
C
Clement Ho 已提交
206 207 208 209
      margin-right: 6px;
      height: 12px;
      width: 11px;
    }
P
Phil Hughes 已提交
210
  }
211 212

  .dropdown-header {
A
Annabel Dunstone Gray 已提交
213
    color: $gl-gray-light;
214 215
    font-size: 13px;
    line-height: 22px;
216
    padding: 0 10px;
217 218 219 220 221
  }

  .separator + .dropdown-header {
    padding-top: 2px;
  }
222 223 224 225

  .unclickable {
    cursor: not-allowed;
    padding: 5px 8px;
A
Annabel Dunstone Gray 已提交
226
    color: $gl-gray-light;
227
  }
P
Phil Hughes 已提交
228 229
}

230 231 232 233 234 235 236 237 238 239
.dropdown-menu-large {
  width: 340px;
}

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

P
Phil Hughes 已提交
240 241 242 243
.dropdown-menu-full-width {
  width: 100%;
}

P
Phil Hughes 已提交
244
.dropdown-menu-paging {
245 246
  .dropdown-page-two,
  .dropdown-menu-back {
P
Phil Hughes 已提交
247 248 249 250 251 252 253 254
    display: none;
  }

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

255 256
    .dropdown-page-two,
    .dropdown-menu-back {
P
Phil Hughes 已提交
257 258
      display: block;
    }
259 260 261 262

    .dropdown-content {
      padding: 0 10px;
    }
P
Phil Hughes 已提交
263 264 265 266 267 268 269 270 271 272 273 274 275
  }
}

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

.dropdown-menu-user-link {
J
Jacob Schatz 已提交
276
  padding-top: 10px;
P
Phil Hughes 已提交
277 278 279 280 281
  padding-bottom: 7px;
}

.dropdown-menu-user-full-name {
  display: block;
J
Jacob Schatz 已提交
282
  font-weight: 500;
283
  line-height: 16px;
P
Phil Hughes 已提交
284 285 286 287 288 289 290
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-menu-user-username {
  display: block;
291
  line-height: 16px;
P
Phil Hughes 已提交
292 293 294 295 296 297
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-select {
298
  width: $dropdown-width;
P
Phil Hughes 已提交
299 300
}

P
Phil Hughes 已提交
301 302 303 304 305 306 307 308 309
.dropdown-menu-align-right {
  left: auto;
  right: 0;
}

.dropdown-menu-selectable {
  a {
    padding-left: 25px;

310 311
    &.is-indeterminate,
    &.is-active {
P
Phil Hughes 已提交
312 313
      &::before {
        position: absolute;
314
        left: 5px;
315
        top: 8px;
P
Phil Hughes 已提交
316 317 318 319 320 321 322
        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 已提交
323

324
    &.is-indeterminate::before {
A
Alfredo Sumaran 已提交
325 326 327 328 329 330
      content: "\f068";
    }

    &.is-active::before {
      content: "\f00c";
    }
P
Phil Hughes 已提交
331 332 333
  }
}

P
Phil Hughes 已提交
334 335 336

.dropdown-title {
  position: relative;
P
Phil Hughes 已提交
337
  padding: 0 25px 10px;
338
  margin: 0 10px 10px;
P
Phil Hughes 已提交
339 340 341 342 343 344 345 346 347 348 349
  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;
350
  top: 0;
P
Phil Hughes 已提交
351
  padding: 0;
P
Phil Hughes 已提交
352
  color: $dropdown-title-btn-color;
P
Phil Hughes 已提交
353 354 355
  font-size: 14px;
  border: 0;
  background: none;
P
Phil Hughes 已提交
356
  outline: 0;
P
Phil Hughes 已提交
357 358

  &:hover {
P
Phil Hughes 已提交
359
    color: darken($dropdown-title-btn-color, 15%);
P
Phil Hughes 已提交
360 361 362 363
  }
}

.dropdown-menu-close {
P
Phil Hughes 已提交
364
  right: 5px;
365 366
  width: 20px;
  height: 20px;
P
Phil Hughes 已提交
367
  top: -3px;
P
Phil Hughes 已提交
368 369 370
}

.dropdown-menu-back {
371 372
  left: 7px;
  top: 2px;
P
Phil Hughes 已提交
373 374 375 376 377
}

.dropdown-input {
  position: relative;
  margin-bottom: 10px;
378
  padding: 0 10px;
P
Phil Hughes 已提交
379 380 381 382

  .fa {
    position: absolute;
    top: 10px;
383
    right: 20px;
S
Sam Rose 已提交
384
    color: $dropdown-input-fa-color;
P
Phil Hughes 已提交
385 386 387
    font-size: 12px;
    pointer-events: none;
  }
388 389 390 391 392

  .dropdown-input-clear {
    display: none;
    cursor: pointer;
    pointer-events: all;
393 394 395
    right: 22px;
    top: 9px;
    font-size: 14px;
396 397 398 399 400 401 402 403 404 405 406
  }

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

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

409 410
.dropdown-input-field,
.default-dropdown-input {
P
Phil Hughes 已提交
411
  width: 100%;
412
  min-height: 30px;
P
Phil Hughes 已提交
413
  padding: 0 7px;
P
Phil Hughes 已提交
414
  color: $dropdown-input-color;
P
Phil Hughes 已提交
415 416 417 418 419 420 421
  line-height: 30px;
  border: 1px solid $dropdown-divider-color;
  border-radius: 2px;
  outline: 0;

  &:focus {
    color: $dropdown-link-color;
P
Phil Hughes 已提交
422 423
    border-color: $dropdown-input-focus-border;
    box-shadow: 0 0 4px $dropdown-input-focus-shadow;
P
Phil Hughes 已提交
424

425
    ~ .fa {
P
Phil Hughes 已提交
426 427 428 429 430
      color: $dropdown-link-color;
    }
  }

  &:hover {
431
    ~ .fa {
P
Phil Hughes 已提交
432 433 434 435 436 437
      color: $dropdown-link-color;
    }
  }
}

.dropdown-content {
P
Phil Hughes 已提交
438
  max-height: 215px;
439
  overflow-y: auto;
P
Phil Hughes 已提交
440 441 442 443 444 445 446 447 448
}

.dropdown-footer {
  padding-top: 10px;
  margin-top: 10px;
  font-size: 13px;
  border-top: 1px solid $dropdown-divider-color;
}

P
Phil Hughes 已提交
449 450 451 452 453 454 455
.dropdown-due-date-footer {
  padding-top: 0;
  margin-left: 10px;
  margin-right: 10px;
  border-top: 0;
}

456 457 458 459
.dropdown-footer-list {
  font-size: 14px;

  a {
460
    cursor: pointer;
461 462 463 464
    padding-left: 10px;
  }
}

P
Phil Hughes 已提交
465 466 467 468 469 470 471 472
.dropdown-loading {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  z-index: 9;
P
Phil Hughes 已提交
473
  background-color: $dropdown-loading-bg;
P
Phil Hughes 已提交
474 475 476 477 478 479 480 481 482 483
  font-size: 28px;

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

P
Phil Hughes 已提交
485 486 487
.dropdown-label-box {
  position: relative;
  top: 3px;
488
  margin-right: 5px;
P
Phil Hughes 已提交
489
  display: inline-block;
490 491 492
  width: 15px;
  height: 15px;
  border-radius: $border-radius-base;
493
}
P
Phil Hughes 已提交
494 495

.dropdown-menu-due-date {
496 497 498 499
  .dropdown-content {
    max-height: 230px;
  }

P
Phil Hughes 已提交
500 501 502 503 504 505 506 507 508 509 510 511
  .ui-widget {
    table {
      margin: 0;
    }

    &.ui-datepicker-inline {
      padding: 0 10px;
      border: 0;
      width: 100%;
    }

    .ui-datepicker-header {
P
Phil Hughes 已提交
512
      padding: 0 8px 10px;
P
Phil Hughes 已提交
513
      border: 0;
P
Phil Hughes 已提交
514 515 516 517 518 519

      .ui-icon {
        background: none;
        font-size: 20px;
        text-indent: 0;

C
Clement Ho 已提交
520
        &::before {
P
Phil Hughes 已提交
521 522 523
          display: block;
          position: relative;
          top: -2px;
P
Phil Hughes 已提交
524
          color: $dropdown-title-btn-color;
P
Phil Hughes 已提交
525 526 527 528 529 530 531
          font: normal normal normal 14px/1 FontAwesome;
          font-size: inherit;
          text-rendering: auto;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }
      }
P
Phil Hughes 已提交
532 533
    }

534 535 536
    .ui-datepicker-calendar {
      .ui-state-hover,
      .ui-state-active {
S
Sam Rose 已提交
537
        color: $white-light;
538 539
        border: 0;
      }
P
Phil Hughes 已提交
540 541 542 543
    }

    .ui-datepicker-prev,
    .ui-datepicker-next {
P
Phil Hughes 已提交
544 545 546 547
      top: 0;
      height: 15px;
      cursor: pointer;

P
Phil Hughes 已提交
548 549 550
      &:hover {
        background-color: transparent;
        border: 0;
P
Phil Hughes 已提交
551

C
Clement Ho 已提交
552
        .ui-icon::before {
P
Phil Hughes 已提交
553 554
          color: $md-link-color;
        }
P
Phil Hughes 已提交
555 556 557 558
      }
    }

    .ui-datepicker-prev {
P
Phil Hughes 已提交
559 560
      left: 0;

C
Clement Ho 已提交
561
      .ui-icon::before {
P
Phil Hughes 已提交
562 563 564
        content: '\f104';
        text-align: left;
      }
P
Phil Hughes 已提交
565 566 567
    }

    .ui-datepicker-next {
P
Phil Hughes 已提交
568 569
      right: 0;

C
Clement Ho 已提交
570
      .ui-icon::before {
P
Phil Hughes 已提交
571 572 573
        content: '\f105';
        text-align: right;
      }
P
Phil Hughes 已提交
574 575 576 577
    }

    td {
      padding: 0;
P
Phil Hughes 已提交
578
      border: 1px solid $calendar-border-color;
P
Phil Hughes 已提交
579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595

      &:first-child {
        border-left: 0;
      }

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

      a {
        line-height: 17px;
        border: 0;
        border-radius: 0;
      }
    }

    .ui-datepicker-title {
P
Phil Hughes 已提交
596
      color: $gl-gray;
597
      font-size: 14px;
P
Phil Hughes 已提交
598 599 600 601 602 603
      line-height: 1;
      font-weight: normal;
    }
  }

  th {
P
Phil Hughes 已提交
604
    padding: 2px 0;
A
Annabel Dunstone Gray 已提交
605
    color: $note-disabled-comment-color;
P
Phil Hughes 已提交
606 607
    font-weight: normal;
    text-transform: lowercase;
P
Phil Hughes 已提交
608
    border-top: 1px solid $calendar-border-color;
P
Phil Hughes 已提交
609 610 611
  }

  .ui-datepicker-unselectable {
P
Phil Hughes 已提交
612
    background-color: $calendar-unselectable-bg;
P
Phil Hughes 已提交
613 614
  }
}
615 616 617

.dropdown-menu-inner-title {
  display: block;
P
Phil Hughes 已提交
618
  color: $gl-title-color;
619 620 621 622 623
  font-weight: 600;
}

.dropdown-menu-inner-content {
  display: block;
624
  color: $gl-gray-light;
625
}
P
Phil Hughes 已提交
626 627 628

.dropdown-toggle-text {
  &.is-default {
629
    color: $gl-gray-light;
P
Phil Hughes 已提交
630 631
  }
}