dropdowns.scss 6.09 KB
Newer Older
Phil Hughes's avatar
Phil Hughes committed
1 2 3 4 5 6
.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  vertical-align: middle;
7
  border-top: $caret-width-base dashed;
Phil Hughes's avatar
Phil Hughes committed
8 9 10 11
  border-right: $caret-width-base solid transparent;
  border-left: $caret-width-base solid transparent;
}

12 13 14 15 16 17
.btn-group {
  .caret {
    margin-left: 0;
  }
}

Phil Hughes's avatar
Phil Hughes committed
18 19
.dropdown {
  position: relative;
20
}
Phil Hughes's avatar
Phil Hughes committed
21

22 23 24
.open {
  .dropdown-menu {
    display: block;
Phil Hughes's avatar
Phil Hughes committed
25
  }
26 27 28 29 30 31 32 33 34 35 36 37

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

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

.dropdown-menu-toggle {
  position: relative;
38
  width: 160px;
Phil Hughes's avatar
Phil Hughes committed
39
  padding: 6px 20px 6px 10px;
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
  background-color: $dropdown-toggle-bg;
  color: $dropdown-toggle-color;
  font-size: 15px;
  text-align: left;
  border: 1px solid $dropdown-toggle-border-color;
  border-radius: 2px;
  outline: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;

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

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

    .fa {
      color: $dropdown-toggle-hover-icon-color;
    }
  }
Phil Hughes's avatar
Phil Hughes committed
67 68 69 70 71 72 73
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
74
  z-index: 9;
Phil Hughes's avatar
Phil Hughes committed
75 76
  width: 240px;
  margin-top: 2px;
77
  margin-bottom: 0;
78
  padding: 10px;
79 80
  font-size: 14px;
  font-weight: normal;
Phil Hughes's avatar
Phil Hughes committed
81 82 83 84 85
  background-color: $dropdown-bg;
  border: 1px solid $dropdown-border-color;
  border-radius: $border-radius-base;
  box-shadow: 0 2px 4px $dropdown-shadow-color;

Phil Hughes's avatar
Phil Hughes committed
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
  &.is-loading {
    .dropdown-content {
      display: none;
    }

    .dropdown-loading {
      display: block;
    }
  }

  ul {
    margin: 0;
    padding: 0;
  }

Phil Hughes's avatar
Phil Hughes committed
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
  li {
    text-align: left;
    list-style: none;
  }

  .divider {
    width: 100%;
    height: 1px;
    margin-top: 8px;
    margin-bottom: 8px;
    background-color: $dropdown-divider-color;
  }

  a {
    display: block;
    position: relative;
    padding-left: 10px;
    padding-right: 10px;
    color: $dropdown-link-color;
120
    line-height: 34px;
Phil Hughes's avatar
Phil Hughes committed
121 122 123 124 125
    text-overflow: ellipsis;
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;

Phil Hughes's avatar
Phil Hughes committed
126 127 128
    &:hover,
    &:focus,
    &.is-focused {
Phil Hughes's avatar
Phil Hughes committed
129 130
      background-color: $dropdown-link-hover-bg;
      text-decoration: none;
Phil Hughes's avatar
Phil Hughes committed
131
      outline: 0;
Phil Hughes's avatar
Phil Hughes committed
132
    }
133 134 135 136 137 138

    &.dropdown-menu-empty-link {
      &.is-focused {
        background-color: $dropdown-empty-row-bg;
      }
    }
139 140 141 142

    &.dropdown-menu-user-link {
      line-height: 16px;
    }
Phil Hughes's avatar
Phil Hughes committed
143 144 145
  }
}

Phil Hughes's avatar
Phil Hughes committed
146
.dropdown-menu-paging {
147 148
  .dropdown-page-two,
  .dropdown-menu-back {
Phil Hughes's avatar
Phil Hughes committed
149 150 151 152 153 154 155 156
    display: none;
  }

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

157 158
    .dropdown-page-two,
    .dropdown-menu-back {
Phil Hughes's avatar
Phil Hughes committed
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
      display: block;
    }
  }
}

.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
174
  padding-top: 10px;
Phil Hughes's avatar
Phil Hughes committed
175 176 177 178 179
  padding-bottom: 7px;
}

.dropdown-menu-user-full-name {
  display: block;
Jacob Schatz's avatar
Jacob Schatz committed
180
  font-weight: 500;
181
  line-height: 16px;
Phil Hughes's avatar
Phil Hughes committed
182 183 184 185 186 187 188
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-menu-user-username {
  display: block;
189
  line-height: 16px;
Phil Hughes's avatar
Phil Hughes committed
190 191 192 193 194 195
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.dropdown-select {
196
  width: 300px;
Phil Hughes's avatar
Phil Hughes committed
197 198
}

Phil Hughes's avatar
Phil Hughes committed
199 200 201 202 203 204 205 206 207 208 209 210 211
.dropdown-menu-align-right {
  left: auto;
  right: 0;
}

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

    &.is-active {
      &::before {
        content: "\f00c";
        position: absolute;
212 213 214
        left: 5px;
        top: 50%;
        margin-top: -7px;
Phil Hughes's avatar
Phil Hughes committed
215 216 217 218 219 220 221 222 223 224 225
        font: normal normal normal 14px/1 FontAwesome;
        font-size: inherit;
        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
      }
    }
  }
}

.dropdown-header {
226 227
  padding-left: 5px;
  padding-right: 5px;
Phil Hughes's avatar
Phil Hughes committed
228 229 230 231
  color: $dropdown-header-color;
  font-size: 13px;
  line-height: 22px;
}
Phil Hughes's avatar
Phil Hughes committed
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249

.dropdown-title {
  position: relative;
  margin-bottom: 10px;
  padding-left: 30px;
  padding-right: 30px;
  padding-bottom: 10px;
  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;
250
  top: 0;
Phil Hughes's avatar
Phil Hughes committed
251
  padding: 0;
Phil Hughes's avatar
Phil Hughes committed
252
  color: $dropdown-title-btn-color;
Phil Hughes's avatar
Phil Hughes committed
253 254 255
  font-size: 14px;
  border: 0;
  background: none;
256
  outline: 0;
Phil Hughes's avatar
Phil Hughes committed
257 258

  &:hover {
Phil Hughes's avatar
Phil Hughes committed
259
    color: darken($dropdown-title-btn-color, 15%);
Phil Hughes's avatar
Phil Hughes committed
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
  }
}

.dropdown-menu-close {
  right: 0;
}

.dropdown-menu-back {
  left: 0;
}

.dropdown-input {
  position: relative;
  margin-bottom: 10px;

  .fa {
    position: absolute;
    top: 10px;
    right: 10px;
279
    color: #c7c7c7;
Phil Hughes's avatar
Phil Hughes committed
280 281 282
    font-size: 12px;
    pointer-events: none;
  }
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298

  .dropdown-input-clear {
    display: none;
    cursor: pointer;
    pointer-events: all;
  }

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

    .dropdown-input-search {
      display: none;
    }
  }
Phil Hughes's avatar
Phil Hughes committed
299 300 301 302 303
}

.dropdown-input-field {
  width: 100%;
  padding: 0 7px;
Phil Hughes's avatar
Phil Hughes committed
304
  color: $dropdown-input-color;
Phil Hughes's avatar
Phil Hughes committed
305 306 307 308 309 310 311
  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
312 313
    border-color: $dropdown-input-focus-border;
    box-shadow: 0 0 4px $dropdown-input-focus-shadow;
Phil Hughes's avatar
Phil Hughes committed
314

315
    ~ .fa {
Phil Hughes's avatar
Phil Hughes committed
316 317 318 319 320
      color: $dropdown-link-color;
    }
  }

  &:hover {
321
    ~ .fa {
Phil Hughes's avatar
Phil Hughes committed
322 323 324 325 326 327
      color: $dropdown-link-color;
    }
  }
}

.dropdown-content {
328
  max-height: 215px;
Phil Hughes's avatar
Phil Hughes committed
329 330 331 332 333 334 335 336 337 338
  overflow-y: scroll;
}

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

339 340 341 342 343 344 345 346
.dropdown-footer-list {
  font-size: 14px;

  a {
    padding-left: 10px;
  }
}

Phil Hughes's avatar
Phil Hughes committed
347 348 349 350 351 352 353 354
.dropdown-loading {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  z-index: 9;
Phil Hughes's avatar
Phil Hughes committed
355
  background-color: $dropdown-loading-bg;
Phil Hughes's avatar
Phil Hughes committed
356 357 358 359 360 361 362 363 364 365
  font-size: 28px;

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

367 368 369
.dropdown-label-box {
  position: relative;
  top: 3px;
370
  margin-right: 5px;
371
  display: inline-block;
372 373 374
  width: 15px;
  height: 15px;
  border-radius: $border-radius-base;
375
}