| 1 |
@use "sass:math"; |
| 2 |
|
| 3 |
// base styles |
| 4 |
$selectize: "selectize" !default; |
| 5 |
$select-font-family: inherit !default; |
| 6 |
$select-font-smoothing: inherit !default; |
| 7 |
$select-font-size: 13px !default; |
| 8 |
$select-line-height: 18px !default; |
| 9 |
|
| 10 |
$select-color-rgb: 0,0,0 !default; |
| 11 |
$select-color-text: RGBA($select-color-rgb, 0.83) !default; |
| 12 |
$select-color-border: #d0d0d0 !default; |
| 13 |
$select-color-highlight: rgba(125, 168, 208, 0.2) !default; |
| 14 |
$select-color-input: #fff !default; |
| 15 |
$select-color-input-full: $select-color-input !default; |
| 16 |
$select-color-disabled: #fafafa !default; |
| 17 |
$select-color-item: #f2f2f2 !default; |
| 18 |
$select-color-item-text: $select-color-text !default; |
| 19 |
$select-color-item-border: #d0d0d0 !default; |
| 20 |
$select-color-item-active: #e8e8e8 !default; |
| 21 |
$select-color-item-active-text: $select-color-text !default; |
| 22 |
$select-color-item-active-border: #cacaca !default; |
| 23 |
$select-color-dropdown: #fff !default; |
| 24 |
$select-color-dropdown-border: $select-color-border !default; |
| 25 |
$select-color-dropdown-border-top: #f0f0f0 !default; |
| 26 |
$select-color-dropdown-item-active: #f5fafd !default; |
| 27 |
$select-color-dropdown-item-active-text: #495c68 !default; |
| 28 |
$select-color-dropdown-item-create-text: RGBA($select-color-rgb, 0.5) !default; |
| 29 |
$select-color-dropdown-item-create-active-text: $select-color-dropdown-item-active-text !default; |
| 30 |
$select-color-optgroup: $select-color-dropdown !default; |
| 31 |
$select-color-optgroup-text: $select-color-text !default; |
| 32 |
$select-lighten-disabled-item: 30% !default; |
| 33 |
$select-lighten-disabled-item-text: 30% !default; |
| 34 |
$select-lighten-disabled-item-border: 30% !default; |
| 35 |
$select-opacity-disabled: 0.5 !default; |
| 36 |
|
| 37 |
$select-shadow-input: inset 0 1px 1px rgba(0, 0, 0, 0.1) !default; |
| 38 |
$select-shadow-input-focus: inset 0 1px 2px rgba(0, 0, 0, 0.15) !default; |
| 39 |
$select-border: 1px solid $select-color-border !default; |
| 40 |
$select-dropdown-border: 1px solid $select-color-dropdown-border !default; |
| 41 |
$select-border-radius: 3px !default; |
| 42 |
|
| 43 |
$select-width-item-border: 0px !default; |
| 44 |
$select-max-height-dropdown: 200px !default; |
| 45 |
|
| 46 |
$select-padding-x: 8px !default; |
| 47 |
$select-padding-y: 8px !default; |
| 48 |
$select-padding-item-x: 6px !default; |
| 49 |
$select-padding-item-y: 2px !default; |
| 50 |
$select-padding-dropdown-item-x: $select-padding-x !default; |
| 51 |
$select-padding-dropdown-item-y: 5px !default; |
| 52 |
$select-margin-item-x: 3px !default; |
| 53 |
$select-margin-item-y: 3px !default; |
| 54 |
|
| 55 |
$select-arrow-size: 5px !default; |
| 56 |
$select-arrow-color: #808080 !default; |
| 57 |
$select-arrow-offset: 15px !default; |
| 58 |
|
| 59 |
$select-caret-margin: 0 0px !default; |
| 60 |
$select-caret-margin-rtl: 0 4px 0 -2px !default; |
| 61 |
|
| 62 |
$select-spinner-size: 30px; |
| 63 |
$select-spinner-border-size: 5px; |
| 64 |
$select-spinner-border-color: $select-color-border; |
| 65 |
|
| 66 |
@mixin selectize-vertical-gradient($color-top, $color-bottom) { |
| 67 |
background-color: mix($color-top, $color-bottom, 60%); |
| 68 |
background-image: linear-gradient(to bottom, $color-top, $color-bottom); |
| 69 |
background-repeat: repeat-x; |
| 70 |
} |
| 71 |
|
| 72 |
@import "plugins/drag_drop.scss"; |
| 73 |
@import "plugins/dropdown_header.scss"; |
| 74 |
@import "plugins/optgroup_columns.scss"; |
| 75 |
@import "plugins/remove_button.scss"; |
| 76 |
@import "plugins/clear_button.scss"; |
| 77 |
@import "plugins/auto_position.scss"; |
| 78 |
|
| 79 |
.#{$selectize}-control { |
| 80 |
position: relative; |
| 81 |
} |
| 82 |
|
| 83 |
.#{$selectize}-dropdown, |
| 84 |
.#{$selectize}-input, |
| 85 |
.#{$selectize}-input input { |
| 86 |
color: $select-color-text; |
| 87 |
font-family: $select-font-family; |
| 88 |
font-size: $select-font-size; |
| 89 |
line-height: $select-line-height; |
| 90 |
font-smoothing: $select-font-smoothing; |
| 91 |
} |
| 92 |
|
| 93 |
.#{$selectize}-input, |
| 94 |
.#{$selectize}-control.single .#{$selectize}-input.input-active { |
| 95 |
background: $select-color-input; |
| 96 |
cursor: text; |
| 97 |
display: inline-block; |
| 98 |
} |
| 99 |
|
| 100 |
.#{$selectize}-input { |
| 101 |
border: $select-border; |
| 102 |
padding: $select-padding-y $select-padding-x; |
| 103 |
display: inline-block; |
| 104 |
width: 100%; |
| 105 |
// overflow: hidden; |
| 106 |
position: relative; |
| 107 |
z-index: 1; |
| 108 |
box-sizing: border-box; |
| 109 |
box-shadow: $select-shadow-input; |
| 110 |
border-radius: $select-border-radius; |
| 111 |
|
| 112 |
.#{$selectize}-control.multi &.has-items { |
| 113 |
$padding-x: $select-padding-x; |
| 114 |
$padding-top: calc( |
| 115 |
#{$select-padding-y} - #{$select-padding-item-y} - #{$select-width-item-border} |
| 116 |
); |
| 117 |
$padding-bottom: calc( |
| 118 |
#{$select-padding-y} - #{$select-padding-item-y} - #{$select-margin-item-y} - |
| 119 |
#{$select-width-item-border} |
| 120 |
); |
| 121 |
padding: $padding-top $padding-x $padding-bottom; |
| 122 |
} |
| 123 |
|
| 124 |
&.full { |
| 125 |
background-color: $select-color-input-full; |
| 126 |
} |
| 127 |
&.disabled, |
| 128 |
&.disabled * { |
| 129 |
cursor: default !important; |
| 130 |
} |
| 131 |
&.focus { |
| 132 |
box-shadow: $select-shadow-input-focus; |
| 133 |
} |
| 134 |
&.dropdown-active { |
| 135 |
border-radius: $select-border-radius $select-border-radius 0 0; |
| 136 |
} |
| 137 |
|
| 138 |
> * { |
| 139 |
vertical-align: baseline; |
| 140 |
display: inline-block; |
| 141 |
zoom: 1; |
| 142 |
} |
| 143 |
.#{$selectize}-control.multi & > div { |
| 144 |
cursor: pointer; |
| 145 |
margin: 0 $select-margin-item-x $select-margin-item-y 0; |
| 146 |
padding: $select-padding-item-y $select-padding-item-x; |
| 147 |
background: $select-color-item; |
| 148 |
color: $select-color-item-text; |
| 149 |
border: $select-width-item-border solid $select-color-item-border; |
| 150 |
|
| 151 |
&.active { |
| 152 |
background: $select-color-item-active; |
| 153 |
color: $select-color-item-active-text; |
| 154 |
border: $select-width-item-border solid $select-color-item-active-border; |
| 155 |
} |
| 156 |
} |
| 157 |
.#{$selectize}-control.multi &.disabled > div { |
| 158 |
&, |
| 159 |
&.active { |
| 160 |
color: lighten(gray, $select-lighten-disabled-item-text); |
| 161 |
background: lighten(gray, $select-lighten-disabled-item); |
| 162 |
border: $select-width-item-border solid |
| 163 |
lighten(gray, $select-lighten-disabled-item-border); |
| 164 |
} |
| 165 |
} |
| 166 |
> input { |
| 167 |
&::-ms-clear { |
| 168 |
display: none; |
| 169 |
} |
| 170 |
display: inline-block !important; |
| 171 |
padding: 0 !important; |
| 172 |
min-height: 0 !important; |
| 173 |
max-height: none !important; |
| 174 |
max-width: 100% !important; |
| 175 |
margin: 0 !important; |
| 176 |
text-indent: 0 !important; |
| 177 |
border: 0 none !important; |
| 178 |
background: none !important; |
| 179 |
line-height: inherit !important; |
| 180 |
user-select: auto !important; |
| 181 |
box-shadow: none !important; |
| 182 |
&:focus { |
| 183 |
outline: none !important; |
| 184 |
} |
| 185 |
|
| 186 |
&[placeholder] { |
| 187 |
box-sizing: initial; |
| 188 |
} |
| 189 |
} |
| 190 |
&.has-items > input { |
| 191 |
margin: $select-caret-margin !important; |
| 192 |
} |
| 193 |
} |
| 194 |
|
| 195 |
.#{$selectize}-input::after { |
| 196 |
content: " "; |
| 197 |
display: block; |
| 198 |
clear: left; |
| 199 |
} |
| 200 |
|
| 201 |
.#{$selectize}-input.dropdown-active::before { |
| 202 |
content: " "; |
| 203 |
display: block; |
| 204 |
position: absolute; |
| 205 |
background: $select-color-dropdown-border-top; |
| 206 |
height: 1px; |
| 207 |
bottom: 0; |
| 208 |
left: 0; |
| 209 |
right: 0; |
| 210 |
} |
| 211 |
|
| 212 |
.#{$selectize}-dropdown { |
| 213 |
position: absolute; |
| 214 |
top: 100%; |
| 215 |
left: 0; |
| 216 |
width: 100%; |
| 217 |
z-index: 10; |
| 218 |
|
| 219 |
border: $select-dropdown-border; |
| 220 |
background: $select-color-dropdown; |
| 221 |
margin: -1px 0 0 0; |
| 222 |
border-top: 0 none; |
| 223 |
box-sizing: border-box; |
| 224 |
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); |
| 225 |
border-radius: 0 0 $select-border-radius $select-border-radius; |
| 226 |
|
| 227 |
[data-selectable] { |
| 228 |
cursor: pointer; |
| 229 |
overflow: hidden; |
| 230 |
.highlight { |
| 231 |
background: $select-color-highlight; |
| 232 |
border-radius: 1px; |
| 233 |
} |
| 234 |
} |
| 235 |
.option, |
| 236 |
.optgroup-header, |
| 237 |
.no-results, |
| 238 |
.create { |
| 239 |
padding: $select-padding-dropdown-item-y $select-padding-dropdown-item-x; |
| 240 |
} |
| 241 |
.option, |
| 242 |
[data-disabled], |
| 243 |
[data-disabled] [data-selectable].option { |
| 244 |
cursor: inherit; |
| 245 |
opacity: 0.5; |
| 246 |
} |
| 247 |
[data-selectable].option { |
| 248 |
opacity: 1; |
| 249 |
cursor: pointer; |
| 250 |
} |
| 251 |
.optgroup:first-child .optgroup-header { |
| 252 |
border-top: 0 none; |
| 253 |
} |
| 254 |
.optgroup-header { |
| 255 |
color: $select-color-optgroup-text; |
| 256 |
background: $select-color-optgroup; |
| 257 |
cursor: default; |
| 258 |
} |
| 259 |
.active { |
| 260 |
background-color: $select-color-item-active; |
| 261 |
color: $select-color-item-active-text; |
| 262 |
&.create { |
| 263 |
color: $select-color-dropdown-item-create-active-text; |
| 264 |
} |
| 265 |
} |
| 266 |
|
| 267 |
.selected { |
| 268 |
background-color: $select-color-item-active; |
| 269 |
color: $select-color-item-active-text; |
| 270 |
} |
| 271 |
.create { |
| 272 |
color: $select-color-dropdown-item-create-text; |
| 273 |
} |
| 274 |
|
| 275 |
.active:not(.selected) { |
| 276 |
background: $select-color-dropdown-item-active; |
| 277 |
color: $select-color-dropdown-item-active-text; |
| 278 |
} |
| 279 |
} |
| 280 |
|
| 281 |
.#{$selectize}-dropdown-content { |
| 282 |
overflow-y: auto; |
| 283 |
overflow-x: hidden; |
| 284 |
max-height: $select-max-height-dropdown; |
| 285 |
overflow-scrolling: touch; |
| 286 |
} |
| 287 |
|
| 288 |
.#{$selectize}-dropdown-emptyoptionlabel { |
| 289 |
text-align: center; |
| 290 |
} |
| 291 |
|
| 292 |
.#{$selectize}-dropdown .spinner { |
| 293 |
display: inline-block; |
| 294 |
width: $select-spinner-size; |
| 295 |
height: $select-spinner-size; |
| 296 |
margin: $select-padding-dropdown-item-y $select-padding-dropdown-item-x; |
| 297 |
|
| 298 |
&:after { |
| 299 |
content: " "; |
| 300 |
display: block; |
| 301 |
width: $select-spinner-size * 0.8; |
| 302 |
height: $select-spinner-size * 0.8; |
| 303 |
margin: $select-spinner-size * 0.1; |
| 304 |
border-radius: 50%; |
| 305 |
border: $select-spinner-border-size solid $select-spinner-border-color; |
| 306 |
border-color: $select-spinner-border-color transparent |
| 307 |
$select-spinner-border-color transparent; |
| 308 |
animation: lds-dual-ring 1.2s linear infinite; |
| 309 |
} |
| 310 |
@keyframes lds-dual-ring { |
| 311 |
0% { |
| 312 |
transform: rotate(0deg); |
| 313 |
} |
| 314 |
100% { |
| 315 |
transform: rotate(360deg); |
| 316 |
} |
| 317 |
} |
| 318 |
} |
| 319 |
|
| 320 |
.#{$selectize}-control.single .#{$selectize}-input { |
| 321 |
&, |
| 322 |
input { |
| 323 |
cursor: pointer; |
| 324 |
} |
| 325 |
&.input-active, |
| 326 |
&.input-active input:not(:read-only) { |
| 327 |
cursor: text; |
| 328 |
} |
| 329 |
|
| 330 |
&:not(.no-arrow):after { |
| 331 |
content: " "; |
| 332 |
display: block; |
| 333 |
position: absolute; |
| 334 |
top: 50%; |
| 335 |
right: $select-arrow-offset; |
| 336 |
margin-top: round(divide(-1 * $select-arrow-size, 2)); |
| 337 |
width: 0; |
| 338 |
height: 0; |
| 339 |
border-style: solid; |
| 340 |
border-width: $select-arrow-size $select-arrow-size 0 $select-arrow-size; |
| 341 |
border-color: $select-arrow-color transparent transparent transparent; |
| 342 |
} |
| 343 |
&:not(.no-arrow).dropdown-active:after { |
| 344 |
margin-top: $select-arrow-size * -0.8; |
| 345 |
border-width: 0 $select-arrow-size $select-arrow-size $select-arrow-size; |
| 346 |
border-color: transparent transparent $select-arrow-color transparent; |
| 347 |
} |
| 348 |
} |
| 349 |
|
| 350 |
.#{$selectize}-control.rtl { |
| 351 |
text-align: right; |
| 352 |
&.single .#{$selectize}-input:after { |
| 353 |
left: $select-arrow-offset; |
| 354 |
right: auto; |
| 355 |
} |
| 356 |
.#{$selectize}-input > input { |
| 357 |
margin: $select-caret-margin-rtl !important; |
| 358 |
} |
| 359 |
} |
| 360 |
|
| 361 |
.#{$selectize}-control .#{$selectize}-input.disabled { |
| 362 |
opacity: $select-opacity-disabled; |
| 363 |
background-color: $select-color-disabled; |
| 364 |
} |