bootstrap-chosen-variables.scss
7 years ago
bootstrap-chosen.scss
7 years ago
bootstrap-variables.scss
7 years ago
chosen-sprite.png
7 years ago
chosen-sprite@2x.png
7 years ago
bootstrap-chosen.scss
459 lines
| 1 | // |
| 2 | // bootstrap-chosen.scss |
| 3 | // |
| 4 | // An alternate stylesheet for Chosen (http://harvesthq.github.com/chosen/). |
| 5 | // This one is supposed to integrate better with Bootstrap. |
| 6 | // |
| 7 | // Submit bugfixes to: http://github.com/alxlit/bootstrap-chosen |
| 8 | // |
| 9 | |
| 10 | @import "bootstrap-chosen-variables.scss"; |
| 11 | |
| 12 | .chosen-select { width: 100%; } |
| 13 | .chosen-select-deselect { width: 100%; } |
| 14 | |
| 15 | .chosen-container { |
| 16 | display: inline-block; |
| 17 | font-size: $font-size-base; |
| 18 | position: relative; |
| 19 | vertical-align: middle; |
| 20 | |
| 21 | .chosen-drop { |
| 22 | background: $chosen-background; |
| 23 | border: 1px solid $chosen-drop-border; |
| 24 | @include border-bottom-radius($chosen-border-radius); |
| 25 | @include box-shadow($chosen-drop-box-shadow); |
| 26 | margin-top: -1px; |
| 27 | position: absolute; |
| 28 | top: 100%; |
| 29 | left: -9000px; |
| 30 | z-index: $chosen-drop-zindex; |
| 31 | } |
| 32 | |
| 33 | &.chosen-with-drop .chosen-drop { |
| 34 | left: 0; |
| 35 | right: 0; |
| 36 | } |
| 37 | |
| 38 | .chosen-results { |
| 39 | color: $gray; |
| 40 | margin: 0 4px 4px 0 !important; |
| 41 | max-height: 240px; |
| 42 | padding: 0 0 0 4px; |
| 43 | position: relative; |
| 44 | overflow-x: hidden; |
| 45 | overflow-y: auto; |
| 46 | -webkit-overflow-scrolling: touch; |
| 47 | |
| 48 | li { |
| 49 | display: none; |
| 50 | line-height: $line-height-base; // 15px; |
| 51 | list-style: none; |
| 52 | margin: 0; |
| 53 | padding: 5px 6px; |
| 54 | |
| 55 | em { |
| 56 | background: #feffde; |
| 57 | font-style: normal; |
| 58 | } |
| 59 | |
| 60 | &.group-result { |
| 61 | display: list-item; |
| 62 | cursor: default; |
| 63 | color: #999; |
| 64 | font-weight: bold; |
| 65 | } |
| 66 | |
| 67 | &.group-option { |
| 68 | padding-left: 15px; |
| 69 | } |
| 70 | |
| 71 | &.active-result { |
| 72 | cursor: pointer; |
| 73 | display: list-item; |
| 74 | } |
| 75 | |
| 76 | &.highlighted { |
| 77 | background-color: $link-color; |
| 78 | background-image: none; |
| 79 | color: white; |
| 80 | |
| 81 | em { |
| 82 | background: transparent; |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | &.disabled-result { |
| 87 | display: list-item; |
| 88 | color: $gray-light; |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | .no-results { |
| 93 | background: $gray-lighter; |
| 94 | display: list-item; |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | .chosen-results-scroll { |
| 99 | background: white; |
| 100 | margin: 0 4px; |
| 101 | position: absolute; |
| 102 | text-align: center; |
| 103 | width: 321px; |
| 104 | z-index: 1; |
| 105 | |
| 106 | span { |
| 107 | display: inline-block; |
| 108 | height: $line-height-base; // 17px; |
| 109 | text-indent: -5000px; |
| 110 | width: 9px; |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | .chosen-results-scroll-down { |
| 115 | bottom: 0; |
| 116 | |
| 117 | span { |
| 118 | background: url($chosen-sprite-path) no-repeat -4px -3px; |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | .chosen-results-scroll-up { |
| 123 | span { |
| 124 | background: url($chosen-sprite-path) no-repeat -22px -3px; |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | .chosen-container-single { |
| 130 | .chosen-single { |
| 131 | background-color: $chosen-background !important; |
| 132 | -webkit-background-clip: padding-box; |
| 133 | -moz-background-clip: padding; |
| 134 | background-clip: padding-box; |
| 135 | border: $chosen-border; |
| 136 | @include border-top-radius($chosen-border-radius); |
| 137 | @include border-bottom-radius($chosen-border-radius); |
| 138 | @include box-shadow($chosen-box-shadow); |
| 139 | color: $gray; |
| 140 | display: block; |
| 141 | height: $chosen-height; |
| 142 | overflow: hidden; |
| 143 | line-height: $chosen-height; |
| 144 | padding: 0 0 0 8px; |
| 145 | position: relative; |
| 146 | text-decoration: none; |
| 147 | white-space: nowrap; |
| 148 | |
| 149 | span { |
| 150 | display: block; |
| 151 | margin-right: 26px; |
| 152 | @include text-overflow(); |
| 153 | } |
| 154 | |
| 155 | abbr { |
| 156 | background: url($chosen-sprite-path) right top no-repeat; |
| 157 | display: block; |
| 158 | font-size: 1px; |
| 159 | height: 10px; |
| 160 | position: absolute; |
| 161 | right: 26px; |
| 162 | top: ($chosen-height - 10px) / 2; |
| 163 | width: 12px; |
| 164 | |
| 165 | &:hover { |
| 166 | background-position: right -11px; |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | &.chosen-disabled .chosen-single abbr:hover { |
| 171 | background-position: right 2px; |
| 172 | } |
| 173 | |
| 174 | div { |
| 175 | display: block; |
| 176 | height: 100%; |
| 177 | position: absolute; |
| 178 | top: 0; |
| 179 | right: 0; |
| 180 | width: 18px; |
| 181 | |
| 182 | b { |
| 183 | background: url($chosen-sprite-path) no-repeat 0 11px; |
| 184 | display: block; |
| 185 | height: 100%; |
| 186 | width: 100%; |
| 187 | } |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | .chosen-default { |
| 192 | color: $gray-light; |
| 193 | } |
| 194 | |
| 195 | .chosen-search { |
| 196 | margin: 0; |
| 197 | padding: 3px 4px; |
| 198 | position: relative; |
| 199 | white-space: nowrap; |
| 200 | z-index: $zindex-dropdown; |
| 201 | |
| 202 | input[type="text"]="text""] { |
| 203 | background: url($chosen-sprite-path) no-repeat 100% -20px, $chosen-background; |
| 204 | border: $chosen-border; |
| 205 | @include border-top-radius($chosen-border-radius); |
| 206 | @include border-bottom-radius($chosen-border-radius); |
| 207 | @include box-shadow($chosen-box-shadow); |
| 208 | margin: 1px 0; |
| 209 | padding: 4px 20px 4px 4px; |
| 210 | width: 100%; |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | .chosen-drop { |
| 215 | margin-top: -1px; |
| 216 | @include border-bottom-radius($chosen-border-radius); |
| 217 | -webkit-background-clip: padding-box; |
| 218 | -moz-background-clip: padding; |
| 219 | background-clip: padding-box; |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | .chosen-container-single-nosearch { |
| 224 | .chosen-search { |
| 225 | input[type="text"]="text""] { |
| 226 | position: absolute; |
| 227 | left: -9000px; |
| 228 | } |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | .chosen-container-multi { |
| 233 | .chosen-choices { |
| 234 | background-color: $chosen-background; |
| 235 | border: $chosen-border; |
| 236 | @include border-top-radius($chosen-multi-border-radius); |
| 237 | @include border-bottom-radius($chosen-multi-border-radius); |
| 238 | @include box-shadow($chosen-box-shadow); |
| 239 | cursor: text; |
| 240 | height: auto !important; |
| 241 | height: 1%; |
| 242 | margin: 0; |
| 243 | overflow: hidden; |
| 244 | padding: 0; |
| 245 | position: relative; |
| 246 | |
| 247 | li { |
| 248 | float: left; |
| 249 | list-style: none; |
| 250 | } |
| 251 | |
| 252 | .search-field { |
| 253 | margin: 0; |
| 254 | padding: 0; |
| 255 | white-space: nowrap; |
| 256 | |
| 257 | input[type="text"]="text""] { |
| 258 | background: transparent !important; |
| 259 | border: 0 !important; |
| 260 | @include box-shadow(none); |
| 261 | color: $gray; |
| 262 | height: $chosen-multi-height - 8px; |
| 263 | margin: 0; |
| 264 | padding: 4px; |
| 265 | outline: 0; |
| 266 | } |
| 267 | |
| 268 | .default { |
| 269 | color: #999; |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | .search-choice { |
| 274 | -webkit-background-clip: padding-box; |
| 275 | -moz-background-clip: padding; |
| 276 | background-clip: padding-box; |
| 277 | background-color: $gray-lighter; |
| 278 | border: $chosen-border; |
| 279 | @include border-top-radius($chosen-border-radius); |
| 280 | @include border-bottom-radius($chosen-border-radius); |
| 281 | @include gradient-vertical(white, $gray-lighter); |
| 282 | @include box-shadow($chosen-box-shadow); |
| 283 | color: $gray-dark; |
| 284 | cursor: default; |
| 285 | line-height: 13px; |
| 286 | margin: 6px 0 3px 5px; |
| 287 | padding: 3px 20px 3px 5px; |
| 288 | position: relative; |
| 289 | |
| 290 | .search-choice-close { |
| 291 | background: url($chosen-sprite-path) right top no-repeat; |
| 292 | display: block; |
| 293 | font-size: 1px; |
| 294 | height: 10px; |
| 295 | position: absolute; |
| 296 | right: 4px; |
| 297 | top: 5px; |
| 298 | width: 12px; |
| 299 | cursor: pointer; |
| 300 | |
| 301 | &:hover { |
| 302 | background-position: right -11px; |
| 303 | } |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | .search-choice-focus { |
| 308 | background: #d4d4d4; |
| 309 | |
| 310 | .search-choice-close { |
| 311 | background-position: right -11px; |
| 312 | } |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | .chosen-results { |
| 317 | margin: 0 0 0 0; |
| 318 | padding: 0; |
| 319 | } |
| 320 | |
| 321 | .chosen-drop { |
| 322 | .result-selected { |
| 323 | display: none; |
| 324 | } |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | .chosen-container-active { |
| 329 | .chosen-single { |
| 330 | border: $chosen-focus-border; |
| 331 | @include box-shadow($chosen-focus-box-shadow); |
| 332 | @include transition($chosen-focus-transition); |
| 333 | } |
| 334 | |
| 335 | &.chosen-with-drop .chosen-single { |
| 336 | background-color: $input-bg; |
| 337 | border: $chosen-focus-border; |
| 338 | @include border-bottom-radius(0); |
| 339 | @include box-shadow($chosen-focus-box-shadow); |
| 340 | @include transition($chosen-focus-transition); |
| 341 | |
| 342 | div { |
| 343 | background: transparent; |
| 344 | border-left: none; |
| 345 | |
| 346 | b { |
| 347 | background-position: -18px 11px; |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | .chosen-choices { |
| 353 | border: $chosen-focus-border; |
| 354 | @include border-bottom-radius(0); |
| 355 | @include box-shadow($chosen-focus-box-shadow); |
| 356 | @include transition($chosen-focus-transition); |
| 357 | |
| 358 | .search-field input[type="text"]="text""] { |
| 359 | color: #111 !important; |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | &.chosen-with-drop .chosen-choices { |
| 364 | @include border-bottom-radius(0); |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | .chosen-disabled { |
| 369 | cursor: default; |
| 370 | opacity: 0.5 !important; |
| 371 | |
| 372 | .chosen-single { |
| 373 | cursor: default; |
| 374 | } |
| 375 | |
| 376 | .chosen-choices .search-choice .search-choice-close { |
| 377 | cursor: default; |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | .chosen-rtl { |
| 382 | text-align: right; |
| 383 | |
| 384 | .chosen-single { |
| 385 | padding: 0 8px 0 0; |
| 386 | overflow: visible; |
| 387 | |
| 388 | span { |
| 389 | margin-left: 26px; |
| 390 | margin-right: 0; |
| 391 | direction: rtl; |
| 392 | } |
| 393 | |
| 394 | div { |
| 395 | left: 7px; |
| 396 | right: auto; |
| 397 | } |
| 398 | |
| 399 | abbr { |
| 400 | left: 26px; |
| 401 | right: auto; |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | .chosen-choices { |
| 406 | .search-field input[type="text"]="text""] { |
| 407 | direction: rtl; |
| 408 | } |
| 409 | |
| 410 | li { |
| 411 | float: right; |
| 412 | } |
| 413 | |
| 414 | .search-choice { |
| 415 | margin: 6px 5px 3px 0; |
| 416 | padding: 3px 5px 3px 19px; |
| 417 | |
| 418 | .search-choice-close { |
| 419 | background-position: right top; |
| 420 | left: 4px; |
| 421 | right: auto; |
| 422 | } |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | &.chosen-container-single .chosen-results { |
| 427 | margin: 0 0 4px 4px; |
| 428 | padding: 0 4px 0 0; |
| 429 | } |
| 430 | |
| 431 | .chosen-results .group-option { |
| 432 | padding-left: 0; |
| 433 | padding-right: 15px; |
| 434 | } |
| 435 | |
| 436 | &.chosen-container-active.chosen-with-drop .chosen-single div { |
| 437 | border-right: none; |
| 438 | } |
| 439 | |
| 440 | .chosen-search input[type="text"]="text""] { |
| 441 | background: url($chosen-sprite-path) no-repeat -28px -20px, $chosen-background; |
| 442 | direction: rtl; |
| 443 | padding: 4px 5px 4px 20px; |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 2dppx) { |
| 448 | .chosen-rtl .chosen-search input[type="text"]="text""], |
| 449 | .chosen-container-single .chosen-single abbr, |
| 450 | .chosen-container-single .chosen-single div b, |
| 451 | .chosen-container-single .chosen-search input[type="text"]="text""], |
| 452 | .chosen-container-multi .chosen-choices .search-choice .search-choice-close, |
| 453 | .chosen-container .chosen-results-scroll-down span, |
| 454 | .chosen-container .chosen-results-scroll-up span { |
| 455 | background-image: url($chosen-sprite-retina-path) !important; |
| 456 | background-size: 52px 37px !important; |
| 457 | background-repeat: no-repeat !important; |
| 458 | } |
| 459 | } |