dropdowns.scss 9.6 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
.open {
P
Phil Hughes 已提交
12 13
  .dropdown-menu,
  .dropdown-menu-nav {
14
    display: block;
15

16 17
    @media (max-width: $screen-xs-max) {
      width: 100%;
18
      min-width: 240px;
19
    }
P
Phil Hughes 已提交
20
  }
P
Phil Hughes 已提交
21 22 23 24 25 26 27 28 29 30 31 32

  .dropdown-menu-toggle {
    border-color: $dropdown-toggle-hover-border-color;

    .fa {
      color: $dropdown-toggle-hover-icon-color;
    }
  }
}

.dropdown-menu-toggle {
  position: relative;
33
  width: 160px;
P
Phil Hughes 已提交
34
  padding: 6px 20px 6px 10px;
P
Phil Hughes 已提交
35 36 37 38
  background-color: $dropdown-toggle-bg;
  color: $dropdown-toggle-color;
  font-size: 15px;
  text-align: left;
39
  border: 1px solid $border-color;
P
Phil Hughes 已提交
40
  border-radius: $border-radius-base;
P
Phil Hughes 已提交
41 42 43 44 45 46
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;

  .fa {
    position: absolute;
47 48
    top: 10px;
    right: 8px;
P
Phil Hughes 已提交
49
    color: $dropdown-toggle-icon-color;
50

51 52 53 54
    &.fa-spinner {
      font-size: 16px;
      margin-top: -8px;
    }
P
Phil Hughes 已提交
55 56
  }

57 58 59 60
  &.no-outline {
    outline: 0;
  }

P
Phil Hughes 已提交
61 62 63 64 65 66 67
  &:hover, {
    border-color: $dropdown-toggle-hover-border-color;

    .fa {
      color: $dropdown-toggle-hover-icon-color;
    }
  }
68 69 70 71

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

  &.wide {
    width: 100%;

    + .dropdown-select {
      width: 100%;
    }
  }
80 81 82 83 84 85 86 87 88

  // 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;
  }
P
Phil Hughes 已提交
89 90
}

P
Phil Hughes 已提交
91 92
.dropdown-menu,
.dropdown-menu-nav {
P
Phil Hughes 已提交
93 94 95 96
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
97
  z-index: 9;
P
Phil Hughes 已提交
98 99
  width: 240px;
  margin-top: 2px;
100
  margin-bottom: 0;
101
  font-size: 15px;
102
  font-weight: normal;
P
Phil Hughes 已提交
103
  padding: 8px 0;
P
Phil Hughes 已提交
104 105
  background-color: $dropdown-bg;
  border: 1px solid $dropdown-border-color;
P
Phil Hughes 已提交
106
  border-radius: $border-radius-base;
P
Phil Hughes 已提交
107 108
  box-shadow: 0 2px 4px $dropdown-shadow-color;

P
Phil Hughes 已提交
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
  &.is-loading {
    .dropdown-content {
      display: none;
    }

    .dropdown-loading {
      display: block;
    }
  }

  ul {
    margin: 0;
    padding: 0;
  }

P
Phil Hughes 已提交
124 125 126
  li {
    text-align: left;
    list-style: none;
P
Phil Hughes 已提交
127
    padding: 0 8px;
P
Phil Hughes 已提交
128 129 130
  }

  .divider {
131
    height: 1px;
P
Phil Hughes 已提交
132
    margin: 8px;
133 134 135 136 137
    padding: 0;
    background-color: $dropdown-divider-color;
  }

  .separator {
P
Phil Hughes 已提交
138 139 140 141 142 143 144 145 146 147
    width: 100%;
    height: 1px;
    margin-top: 8px;
    margin-bottom: 8px;
    background-color: $dropdown-divider-color;
  }

  a {
    display: block;
    position: relative;
P
Phil Hughes 已提交
148
    padding: 5px 8px;
P
Phil Hughes 已提交
149
    color: $dropdown-link-color;
P
Phil Hughes 已提交
150
    line-height: initial;
P
Phil Hughes 已提交
151 152 153 154 155
    text-overflow: ellipsis;
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;

P
Phil Hughes 已提交
156 157 158
    &:hover,
    &:focus,
    &.is-focused {
P
Phil Hughes 已提交
159 160
      background-color: $dropdown-link-hover-bg;
      text-decoration: none;
P
Phil Hughes 已提交
161
      outline: 0;
P
Phil Hughes 已提交
162
    }
163 164 165 166 167 168

    &.dropdown-menu-empty-link {
      &.is-focused {
        background-color: $dropdown-empty-row-bg;
      }
    }
A
Alfredo Sumaran 已提交
169 170 171 172

    &.dropdown-menu-user-link {
      line-height: 16px;
    }
C
Clement Ho 已提交
173 174 175 176 177 178 179

    .icon-play {
      fill: $table-text-gray;
      margin-right: 6px;
      height: 12px;
      width: 11px;
    }
P
Phil Hughes 已提交
180
  }
181 182 183 184 185

  .dropdown-header {
    color: $dropdown-header-color;
    font-size: 13px;
    line-height: 22px;
186
    padding: 0 10px;
187 188 189 190 191
  }

  .separator + .dropdown-header {
    padding-top: 2px;
  }
192 193 194 195 196 197

  .unclickable {
    cursor: not-allowed;
    padding: 5px 8px;
    color: $dropdown-header-color;
  }
P
Phil Hughes 已提交
198 199
}

200 201 202 203 204 205 206 207 208 209
.dropdown-menu-large {
  width: 340px;
}

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

P
Phil Hughes 已提交
210 211 212 213
.dropdown-menu-full-width {
  width: 100%;
}

P
Phil Hughes 已提交
214
.dropdown-menu-paging {
215 216
  .dropdown-page-two,
  .dropdown-menu-back {
P
Phil Hughes 已提交
217 218 219 220 221 222 223 224
    display: none;
  }

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

225 226
    .dropdown-page-two,
    .dropdown-menu-back {
P
Phil Hughes 已提交
227 228
      display: block;
    }
229 230 231 232

    .dropdown-content {
      padding: 0 10px;
    }
P
Phil Hughes 已提交
233 234 235 236 237 238 239 240 241 242 243 244 245
  }
}

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

.dropdown-menu-user-link {
J
Jacob Schatz 已提交
246
  padding-top: 10px;
P
Phil Hughes 已提交
247 248 249 250 251
  padding-bottom: 7px;
}

.dropdown-menu-user-full-name {
  display: block;
J
Jacob Schatz 已提交
252
  font-weight: 500;
253
  line-height: 16px;
P
Phil Hughes 已提交
254 255 256 257 258 259 260
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-menu-user-username {
  display: block;
261
  line-height: 16px;
P
Phil Hughes 已提交
262 263 264 265 266 267
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-select {
268
  width: $dropdown-width;
P
Phil Hughes 已提交
269 270
}

P
Phil Hughes 已提交
271 272 273 274 275 276 277 278 279
.dropdown-menu-align-right {
  left: auto;
  right: 0;
}

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

280 281
    &.is-indeterminate,
    &.is-active {
P
Phil Hughes 已提交
282 283
      &::before {
        position: absolute;
284
        left: 5px;
285
        top: 8px;
P
Phil Hughes 已提交
286 287 288 289 290 291 292
        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 已提交
293

294
    &.is-indeterminate::before {
A
Alfredo Sumaran 已提交
295 296 297 298 299 300
      content: "\f068";
    }

    &.is-active::before {
      content: "\f00c";
    }
P
Phil Hughes 已提交
301 302 303
  }
}

P
Phil Hughes 已提交
304 305 306

.dropdown-title {
  position: relative;
P
Phil Hughes 已提交
307
  padding: 0 25px 10px;
308
  margin: 0 10px 10px;
P
Phil Hughes 已提交
309 310 311 312 313 314 315 316 317 318 319
  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;
320
  top: 0;
P
Phil Hughes 已提交
321
  padding: 0;
P
Phil Hughes 已提交
322
  color: $dropdown-title-btn-color;
P
Phil Hughes 已提交
323 324 325
  font-size: 14px;
  border: 0;
  background: none;
P
Phil Hughes 已提交
326
  outline: 0;
P
Phil Hughes 已提交
327 328

  &:hover {
P
Phil Hughes 已提交
329
    color: darken($dropdown-title-btn-color, 15%);
P
Phil Hughes 已提交
330 331 332 333
  }
}

.dropdown-menu-close {
P
Phil Hughes 已提交
334
  right: 5px;
335 336
  width: 20px;
  height: 20px;
P
Phil Hughes 已提交
337
  top: -3px;
P
Phil Hughes 已提交
338 339 340
}

.dropdown-menu-back {
341 342
  left: 7px;
  top: 2px;
P
Phil Hughes 已提交
343 344 345 346 347
}

.dropdown-input {
  position: relative;
  margin-bottom: 10px;
348
  padding: 0 10px;
P
Phil Hughes 已提交
349 350 351 352

  .fa {
    position: absolute;
    top: 10px;
353
    right: 20px;
354
    color: #c7c7c7;
P
Phil Hughes 已提交
355 356 357
    font-size: 12px;
    pointer-events: none;
  }
358 359 360 361 362

  .dropdown-input-clear {
    display: none;
    cursor: pointer;
    pointer-events: all;
363 364 365
    right: 22px;
    top: 9px;
    font-size: 14px;
366 367 368 369 370 371 372 373 374 375 376
  }

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

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

379 380
.dropdown-input-field,
.default-dropdown-input {
P
Phil Hughes 已提交
381
  width: 100%;
382
  min-height: 30px;
P
Phil Hughes 已提交
383
  padding: 0 7px;
P
Phil Hughes 已提交
384
  color: $dropdown-input-color;
P
Phil Hughes 已提交
385 386 387 388 389 390 391
  line-height: 30px;
  border: 1px solid $dropdown-divider-color;
  border-radius: 2px;
  outline: 0;

  &:focus {
    color: $dropdown-link-color;
P
Phil Hughes 已提交
392 393
    border-color: $dropdown-input-focus-border;
    box-shadow: 0 0 4px $dropdown-input-focus-shadow;
P
Phil Hughes 已提交
394

395
    ~ .fa {
P
Phil Hughes 已提交
396 397 398 399 400
      color: $dropdown-link-color;
    }
  }

  &:hover {
401
    ~ .fa {
P
Phil Hughes 已提交
402 403 404 405 406 407
      color: $dropdown-link-color;
    }
  }
}

.dropdown-content {
P
Phil Hughes 已提交
408
  max-height: 215px;
409
  overflow-y: auto;
P
Phil Hughes 已提交
410 411 412 413 414 415 416 417 418
}

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

P
Phil Hughes 已提交
419 420 421 422 423 424 425
.dropdown-due-date-footer {
  padding-top: 0;
  margin-left: 10px;
  margin-right: 10px;
  border-top: 0;
}

426 427 428 429
.dropdown-footer-list {
  font-size: 14px;

  a {
430
    cursor: pointer;
431 432 433 434
    padding-left: 10px;
  }
}

P
Phil Hughes 已提交
435 436 437 438 439 440 441 442
.dropdown-loading {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  z-index: 9;
P
Phil Hughes 已提交
443
  background-color: $dropdown-loading-bg;
P
Phil Hughes 已提交
444 445 446 447 448 449 450 451 452 453
  font-size: 28px;

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

P
Phil Hughes 已提交
455 456 457
.dropdown-label-box {
  position: relative;
  top: 3px;
458
  margin-right: 5px;
P
Phil Hughes 已提交
459
  display: inline-block;
460 461 462
  width: 15px;
  height: 15px;
  border-radius: $border-radius-base;
463
}
P
Phil Hughes 已提交
464 465

.dropdown-menu-due-date {
466 467 468 469
  .dropdown-content {
    max-height: 230px;
  }

P
Phil Hughes 已提交
470 471 472 473 474 475 476 477 478 479 480 481
  .ui-widget {
    table {
      margin: 0;
    }

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

    .ui-datepicker-header {
P
Phil Hughes 已提交
482
      padding: 0 8px 10px;
P
Phil Hughes 已提交
483
      border: 0;
P
Phil Hughes 已提交
484 485 486 487 488 489

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

C
Clement Ho 已提交
490
        &::before {
P
Phil Hughes 已提交
491 492 493
          display: block;
          position: relative;
          top: -2px;
P
Phil Hughes 已提交
494
          color: $dropdown-title-btn-color;
P
Phil Hughes 已提交
495 496 497 498 499 500 501
          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 已提交
502 503
    }

504 505 506 507 508 509
    .ui-datepicker-calendar {
      .ui-state-hover,
      .ui-state-active {
        color: #fff;
        border: 0;
      }
P
Phil Hughes 已提交
510 511 512 513
    }

    .ui-datepicker-prev,
    .ui-datepicker-next {
P
Phil Hughes 已提交
514 515 516 517
      top: 0;
      height: 15px;
      cursor: pointer;

P
Phil Hughes 已提交
518 519 520
      &:hover {
        background-color: transparent;
        border: 0;
P
Phil Hughes 已提交
521

C
Clement Ho 已提交
522
        .ui-icon::before {
P
Phil Hughes 已提交
523 524
          color: $md-link-color;
        }
P
Phil Hughes 已提交
525 526 527 528
      }
    }

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

C
Clement Ho 已提交
531
      .ui-icon::before {
P
Phil Hughes 已提交
532 533 534
        content: '\f104';
        text-align: left;
      }
P
Phil Hughes 已提交
535 536 537
    }

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

C
Clement Ho 已提交
540
      .ui-icon::before {
P
Phil Hughes 已提交
541 542 543
        content: '\f105';
        text-align: right;
      }
P
Phil Hughes 已提交
544 545 546 547
    }

    td {
      padding: 0;
P
Phil Hughes 已提交
548
      border: 1px solid $calendar-border-color;
P
Phil Hughes 已提交
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565

      &: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 已提交
566
      color: $gl-gray;
P
Phil Hughes 已提交
567 568 569 570 571 572 573
      font-size: 15px;
      line-height: 1;
      font-weight: normal;
    }
  }

  th {
P
Phil Hughes 已提交
574
    padding: 2px 0;
P
Phil Hughes 已提交
575
    color: $calendar-header-color;
P
Phil Hughes 已提交
576 577
    font-weight: normal;
    text-transform: lowercase;
P
Phil Hughes 已提交
578
    border-top: 1px solid $calendar-border-color;
P
Phil Hughes 已提交
579 580 581
  }

  .ui-datepicker-unselectable {
P
Phil Hughes 已提交
582
    background-color: $calendar-unselectable-bg;
P
Phil Hughes 已提交
583 584
  }
}
585 586 587

.dropdown-menu-inner-title {
  display: block;
P
Phil Hughes 已提交
588
  color: $gl-title-color;
589 590 591 592 593
  font-weight: 600;
}

.dropdown-menu-inner-content {
  display: block;
P
Phil Hughes 已提交
594
  color: $gl-placeholder-color;
595
}
P
Phil Hughes 已提交
596 597 598 599 600 601

.dropdown-toggle-text {
  &.is-default {
    color: $gl-placeholder-color;
  }
}