dropdowns.scss 9.65 KB
Newer Older
Phil Hughes's avatar
Phil Hughes committed
1 2
.dropdown {
  position: relative;
3 4 5 6 7 8

  .btn-link {
    &:hover {
      cursor: pointer;
    }
  }
9
}
Phil Hughes's avatar
Phil Hughes committed
10

11
.open {
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
    }
Phil Hughes's avatar
Phil Hughes committed
20
  }
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;
Phil Hughes's avatar
Phil Hughes committed
34
  padding: 6px 20px 6px 10px;
35 36 37 38 39
  background-color: $dropdown-toggle-bg;
  color: $dropdown-toggle-color;
  font-size: 15px;
  text-align: left;
  border: 1px solid $dropdown-toggle-border-color;
Phil Hughes's avatar
Phil Hughes committed
40
  border-radius: $border-radius-base;
41 42 43 44 45 46 47 48 49
  outline: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;

  .fa {
    position: absolute;
    top: 50%;
    right: 6px;
50
    margin-top: -6px;
51 52
    color: $dropdown-toggle-icon-color;
    font-size: 10px;
53

54 55 56 57
    &.fa-spinner {
      font-size: 16px;
      margin-top: -8px;
    }
58 59 60 61 62 63 64 65 66
  }

  &:hover, {
    border-color: $dropdown-toggle-hover-border-color;

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

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

  &.wide {
    width: 100%;

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

  // 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;
  }
Phil Hughes's avatar
Phil Hughes committed
88 89
}

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

108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
  &.is-loading {
    .dropdown-content {
      display: none;
    }

    .dropdown-loading {
      display: block;
    }
  }

  ul {
    margin: 0;
    padding: 0;
  }

Phil Hughes's avatar
Phil Hughes committed
123 124 125
  li {
    text-align: left;
    list-style: none;
126
    padding: 0 8px;
Phil Hughes's avatar
Phil Hughes committed
127 128 129
  }

  .divider {
130
    height: 1px;
131
    margin: 8px;
132 133 134 135 136
    padding: 0;
    background-color: $dropdown-divider-color;
  }

  .separator {
Phil Hughes's avatar
Phil Hughes committed
137 138 139 140 141 142 143 144 145 146
    width: 100%;
    height: 1px;
    margin-top: 8px;
    margin-bottom: 8px;
    background-color: $dropdown-divider-color;
  }

  a {
    display: block;
    position: relative;
147
    padding: 5px 8px;
Phil Hughes's avatar
Phil Hughes committed
148
    color: $dropdown-link-color;
Phil Hughes's avatar
Phil Hughes committed
149
    line-height: initial;
Phil Hughes's avatar
Phil Hughes committed
150 151 152 153 154
    text-overflow: ellipsis;
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;

Phil Hughes's avatar
Phil Hughes committed
155 156 157
    &:hover,
    &:focus,
    &.is-focused {
Phil Hughes's avatar
Phil Hughes committed
158 159
      background-color: $dropdown-link-hover-bg;
      text-decoration: none;
Phil Hughes's avatar
Phil Hughes committed
160
      outline: 0;
Phil Hughes's avatar
Phil Hughes committed
161
    }
162 163 164 165 166 167

    &.dropdown-menu-empty-link {
      &.is-focused {
        background-color: $dropdown-empty-row-bg;
      }
    }
168 169 170 171

    &.dropdown-menu-user-link {
      line-height: 16px;
    }
172 173 174 175 176 177 178

    .icon-play {
      fill: $table-text-gray;
      margin-right: 6px;
      height: 12px;
      width: 11px;
    }
Phil Hughes's avatar
Phil Hughes committed
179
  }
180 181 182 183 184

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

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

  .unclickable {
    cursor: not-allowed;
    padding: 5px 8px;
    color: $dropdown-header-color;
  }
Phil Hughes's avatar
Phil Hughes committed
197 198
}

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

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

Phil Hughes's avatar
Phil Hughes committed
209 210 211 212
.dropdown-menu-full-width {
  width: 100%;
}

213
.dropdown-menu-paging {
214 215
  .dropdown-page-two,
  .dropdown-menu-back {
216 217 218 219 220 221 222 223
    display: none;
  }

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

224 225
    .dropdown-page-two,
    .dropdown-menu-back {
226 227
      display: block;
    }
228 229 230 231

    .dropdown-content {
      padding: 0 10px;
    }
232 233 234 235 236 237 238 239 240 241 242 243 244
  }
}

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

.dropdown-menu-user-link {
Jacob Schatz's avatar
Jacob Schatz committed
245
  padding-top: 10px;
246 247 248 249 250
  padding-bottom: 7px;
}

.dropdown-menu-user-full-name {
  display: block;
Jacob Schatz's avatar
Jacob Schatz committed
251
  font-weight: 500;
252
  line-height: 16px;
253 254 255 256 257 258 259
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-menu-user-username {
  display: block;
260
  line-height: 16px;
261 262 263 264 265 266
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-select {
267
  width: $dropdown-width;
268 269
}

Phil Hughes's avatar
Phil Hughes committed
270 271 272 273 274 275 276 277 278
.dropdown-menu-align-right {
  left: auto;
  right: 0;
}

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

Alfredo Sumaran's avatar
Alfredo Sumaran committed
279
    &.is-indeterminate, &.is-active {
Phil Hughes's avatar
Phil Hughes committed
280 281
      &::before {
        position: absolute;
282
        left: 5px;
283
        top: 8px;
Phil Hughes's avatar
Phil Hughes committed
284 285 286 287 288 289 290
        font: normal normal normal 14px/1 FontAwesome;
        font-size: inherit;
        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
      }
    }
291

292
    &.is-indeterminate::before {
293 294 295 296 297 298
      content: "\f068";
    }

    &.is-active::before {
      content: "\f00c";
    }
Phil Hughes's avatar
Phil Hughes committed
299 300 301
  }
}

302 303 304

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

  &:hover {
Phil Hughes's avatar
Phil Hughes committed
327
    color: darken($dropdown-title-btn-color, 15%);
328 329 330 331
  }
}

.dropdown-menu-close {
332
  right: 5px;
333 334
  width: 20px;
  height: 20px;
Phil Hughes's avatar
Phil Hughes committed
335
  top: -3px;
336 337 338
}

.dropdown-menu-back {
339 340
  left: 7px;
  top: 2px;
341 342 343 344 345
}

.dropdown-input {
  position: relative;
  margin-bottom: 10px;
346
  padding: 0 10px;
347 348 349 350

  .fa {
    position: absolute;
    top: 10px;
351
    right: 20px;
352
    color: #c7c7c7;
353 354 355
    font-size: 12px;
    pointer-events: none;
  }
356 357 358 359 360

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

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

    .dropdown-input-search {
      display: none;
    }
  }
375 376
}

377
.dropdown-input-field, .default-dropdown-input {
378
  width: 100%;
379
  min-height: 30px;
380
  padding: 0 7px;
Phil Hughes's avatar
Phil Hughes committed
381
  color: $dropdown-input-color;
382 383 384 385 386 387 388
  line-height: 30px;
  border: 1px solid $dropdown-divider-color;
  border-radius: 2px;
  outline: 0;

  &:focus {
    color: $dropdown-link-color;
Phil Hughes's avatar
Phil Hughes committed
389 390
    border-color: $dropdown-input-focus-border;
    box-shadow: 0 0 4px $dropdown-input-focus-shadow;
391

392
    ~ .fa {
393 394 395 396 397
      color: $dropdown-link-color;
    }
  }

  &:hover {
398
    ~ .fa {
399 400 401 402 403 404
      color: $dropdown-link-color;
    }
  }
}

.dropdown-content {
405
  max-height: 215px;
406 407 408 409 410 411 412 413 414 415
  overflow-y: scroll;
}

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

416 417 418 419 420 421 422
.dropdown-due-date-footer {
  padding-top: 0;
  margin-left: 10px;
  margin-right: 10px;
  border-top: 0;
}

423 424 425 426
.dropdown-footer-list {
  font-size: 14px;

  a {
427
    cursor: pointer;
428 429 430 431
    padding-left: 10px;
  }
}

432 433 434 435 436 437 438 439
.dropdown-loading {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  z-index: 9;
Phil Hughes's avatar
Phil Hughes committed
440
  background-color: $dropdown-loading-bg;
441 442 443 444 445 446 447 448 449 450
  font-size: 28px;

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

452 453 454
.dropdown-label-box {
  position: relative;
  top: 3px;
455
  margin-right: 5px;
456
  display: inline-block;
457 458 459
  width: 15px;
  height: 15px;
  border-radius: $border-radius-base;
460
}
461 462

.dropdown-menu-due-date {
463 464 465 466
  .dropdown-content {
    max-height: 230px;
  }

467 468 469 470 471 472 473 474 475 476 477 478
  .ui-widget {
    table {
      margin: 0;
    }

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

    .ui-datepicker-header {
Phil Hughes's avatar
Phil Hughes committed
479
      padding: 0 8px 10px;
480
      border: 0;
Phil Hughes's avatar
Phil Hughes committed
481 482 483 484 485 486 487 488 489 490

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

        &:before {
          display: block;
          position: relative;
          top: -2px;
Phil Hughes's avatar
Phil Hughes committed
491
          color: $dropdown-title-btn-color;
Phil Hughes's avatar
Phil Hughes committed
492 493 494 495 496 497 498
          font: normal normal normal 14px/1 FontAwesome;
          font-size: inherit;
          text-rendering: auto;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }
      }
499 500
    }

501 502 503 504 505 506
    .ui-datepicker-calendar {
      .ui-state-hover,
      .ui-state-active {
        color: #fff;
        border: 0;
      }
507 508 509 510
    }

    .ui-datepicker-prev,
    .ui-datepicker-next {
Phil Hughes's avatar
Phil Hughes committed
511 512 513 514
      top: 0;
      height: 15px;
      cursor: pointer;

515 516 517
      &:hover {
        background-color: transparent;
        border: 0;
Phil Hughes's avatar
Phil Hughes committed
518 519 520 521

        .ui-icon:before {
          color: $md-link-color;
        }
522 523 524 525
      }
    }

    .ui-datepicker-prev {
Phil Hughes's avatar
Phil Hughes committed
526 527 528 529 530 531
      left: 0;

      .ui-icon:before {
        content: '\f104';
        text-align: left;
      }
532 533 534
    }

    .ui-datepicker-next {
Phil Hughes's avatar
Phil Hughes committed
535 536 537 538 539 540
      right: 0;

      .ui-icon:before {
        content: '\f105';
        text-align: right;
      }
541 542 543 544
    }

    td {
      padding: 0;
Phil Hughes's avatar
Phil Hughes committed
545
      border: 1px solid $calendar-border-color;
546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562

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

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

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

    .ui-datepicker-title {
Phil Hughes's avatar
Phil Hughes committed
563
      color: $gl-gray;
564 565 566 567 568 569 570
      font-size: 15px;
      line-height: 1;
      font-weight: normal;
    }
  }

  th {
Phil Hughes's avatar
Phil Hughes committed
571
    padding: 2px 0;
Phil Hughes's avatar
Phil Hughes committed
572
    color: $calendar-header-color;
573 574
    font-weight: normal;
    text-transform: lowercase;
Phil Hughes's avatar
Phil Hughes committed
575
    border-top: 1px solid $calendar-border-color;
576 577 578
  }

  .ui-datepicker-unselectable {
Phil Hughes's avatar
Phil Hughes committed
579
    background-color: $calendar-unselectable-bg;
580 581
  }
}
582 583 584

.dropdown-menu-inner-title {
  display: block;
Phil Hughes's avatar
Phil Hughes committed
585
  color: $gl-title-color;
586 587 588 589 590
  font-weight: 600;
}

.dropdown-menu-inner-content {
  display: block;
Phil Hughes's avatar
Phil Hughes committed
591
  color: $gl-placeholder-color;
592
}
593 594 595 596 597 598

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