2019-07-18 14:22:11 +00:00
|
|
|
//
|
|
|
|
// Plugin: Select2
|
|
|
|
//
|
2015-10-31 21:00:16 +00:00
|
|
|
|
|
|
|
//Signle select
|
2019-09-25 08:24:16 +00:00
|
|
|
// .select2-container--default,
|
|
|
|
// .select2-selection {
|
|
|
|
// &.select2-container--focus,
|
|
|
|
// &:focus,
|
|
|
|
// &:active {
|
|
|
|
// outline: none;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
.select2-container--default {
|
2015-10-31 21:00:16 +00:00
|
|
|
.select2-selection--single {
|
2019-09-25 08:24:16 +00:00
|
|
|
border: $input-border-width solid $input-border-color;
|
2016-10-22 19:32:28 +00:00
|
|
|
//border-radius: $input-radius;
|
2019-10-31 11:59:46 +00:00
|
|
|
padding: ($input-padding-y * 1.25) $input-padding-x;
|
2019-07-29 19:37:35 +00:00
|
|
|
height: $input-height;
|
2015-10-31 21:00:16 +00:00
|
|
|
}
|
|
|
|
|
2019-08-20 10:48:22 +00:00
|
|
|
&.select2-container--open {
|
2020-02-13 12:50:38 +00:00
|
|
|
.select2-selection--single {
|
|
|
|
border-color: lighten($primary, 25%);
|
|
|
|
}
|
2019-08-20 10:48:22 +00:00
|
|
|
}
|
2015-10-31 21:00:16 +00:00
|
|
|
|
2019-08-20 10:48:22 +00:00
|
|
|
& .select2-dropdown {
|
2019-09-25 08:24:16 +00:00
|
|
|
border: $input-border-width solid $input-border-color;
|
2019-08-20 10:48:22 +00:00
|
|
|
//border-radius: $input-radius;
|
|
|
|
}
|
2015-10-31 21:00:16 +00:00
|
|
|
|
2019-08-20 10:48:22 +00:00
|
|
|
& .select2-results__option {
|
|
|
|
padding: 6px 12px;
|
|
|
|
user-select: none;
|
|
|
|
}
|
2015-10-31 21:00:16 +00:00
|
|
|
|
2019-08-20 10:48:22 +00:00
|
|
|
& .select2-selection--single .select2-selection__rendered {
|
|
|
|
padding-left: 0;
|
2019-10-11 10:22:05 +00:00
|
|
|
//padding-right: 0;
|
2019-08-20 10:48:22 +00:00
|
|
|
height: auto;
|
|
|
|
margin-top: -3px;
|
|
|
|
}
|
2015-10-31 21:00:16 +00:00
|
|
|
|
2019-08-20 10:48:22 +00:00
|
|
|
&[dir="rtl"] .select2-selection--single .select2-selection__rendered {
|
|
|
|
padding-right: 6px;
|
|
|
|
padding-left: 20px;
|
|
|
|
}
|
2015-10-31 21:00:16 +00:00
|
|
|
|
2019-08-20 10:48:22 +00:00
|
|
|
& .select2-selection--single .select2-selection__arrow {
|
|
|
|
height: 31px;
|
|
|
|
right: 6px;
|
|
|
|
}
|
2015-10-31 21:00:16 +00:00
|
|
|
|
2019-08-20 10:48:22 +00:00
|
|
|
& .select2-selection--single .select2-selection__arrow b {
|
|
|
|
margin-top: 0;
|
|
|
|
}
|
2015-10-31 21:00:16 +00:00
|
|
|
|
2019-08-20 10:48:22 +00:00
|
|
|
.select2-dropdown,
|
|
|
|
.select2-search--inline {
|
|
|
|
.select2-search__field {
|
2019-09-25 08:24:16 +00:00
|
|
|
border: $input-border-width solid $input-border-color;
|
|
|
|
|
2019-08-20 10:48:22 +00:00
|
|
|
&:focus {
|
|
|
|
outline: none;
|
2019-09-25 08:24:16 +00:00
|
|
|
border: $input-border-width solid $input-focus-border-color;
|
2019-08-20 10:48:22 +00:00
|
|
|
}
|
2015-10-31 21:00:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-25 08:24:16 +00:00
|
|
|
.select2-dropdown {
|
|
|
|
&.select2-dropdown--below {
|
|
|
|
border-top: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.select2-dropdown--above {
|
|
|
|
border-bottom: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.select2-results__option {
|
|
|
|
&[aria-disabled='true'] {
|
|
|
|
color: $gray-600;
|
|
|
|
}
|
|
|
|
|
|
|
|
&[aria-selected='true'] {
|
|
|
|
$color: $gray-300;
|
|
|
|
|
|
|
|
background-color: $color;
|
|
|
|
|
|
|
|
&,
|
|
|
|
&:hover {
|
|
|
|
color: color-yiq($color);
|
|
|
|
}
|
|
|
|
}
|
2015-10-31 21:00:16 +00:00
|
|
|
}
|
|
|
|
|
2019-09-25 08:24:16 +00:00
|
|
|
.select2-results__option--highlighted {
|
|
|
|
$color: $primary;
|
|
|
|
background-color: $color;
|
|
|
|
color: color-yiq($color);
|
|
|
|
|
|
|
|
&[aria-selected] {
|
|
|
|
$color: darken($color, 3%);
|
|
|
|
|
|
|
|
&,
|
|
|
|
&:hover {
|
|
|
|
background-color: $color;
|
|
|
|
color: color-yiq($color);
|
|
|
|
}
|
2015-10-31 21:00:16 +00:00
|
|
|
}
|
2019-08-20 10:48:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//Multiple select
|
|
|
|
& {
|
|
|
|
.select2-selection--multiple {
|
2019-09-25 08:24:16 +00:00
|
|
|
border: $input-border-width solid $input-border-color;
|
2019-10-12 10:02:07 +00:00
|
|
|
min-height: $input-height;
|
2019-09-25 08:24:16 +00:00
|
|
|
|
2019-08-20 10:48:22 +00:00
|
|
|
&:focus {
|
2019-09-25 08:24:16 +00:00
|
|
|
border-color: $input-focus-border-color;
|
2019-08-20 10:48:22 +00:00
|
|
|
}
|
2019-06-14 07:33:43 +00:00
|
|
|
|
2019-09-25 08:24:16 +00:00
|
|
|
.select2-selection__rendered {
|
2019-10-31 11:59:46 +00:00
|
|
|
padding: 0 $input-padding-x / 2 $input-padding-y;
|
|
|
|
margin-bottom: -$input-padding-x / 2;
|
2019-09-25 08:24:16 +00:00
|
|
|
|
|
|
|
li:first-child.select2-search.select2-search--inline {
|
|
|
|
width: 100%;
|
2019-10-31 11:59:46 +00:00
|
|
|
margin-left: $input-padding-x / 2;
|
2019-06-14 07:33:43 +00:00
|
|
|
|
2019-09-25 08:24:16 +00:00
|
|
|
.select2-search__field {
|
|
|
|
width: 100% !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.select2-search.select2-search--inline {
|
|
|
|
.select2-search__field {
|
|
|
|
border: 0;
|
|
|
|
margin-top: 6px;
|
|
|
|
}
|
2019-08-20 10:48:22 +00:00
|
|
|
}
|
2019-06-14 07:33:43 +00:00
|
|
|
}
|
2019-09-25 08:24:16 +00:00
|
|
|
|
2019-10-31 07:47:54 +00:00
|
|
|
.select2-selection__choice {
|
|
|
|
background-color: $primary;
|
|
|
|
border-color: darken($primary, 5%);
|
|
|
|
color: color-yiq($primary);
|
|
|
|
padding: 0 10px;
|
|
|
|
margin-top: .31rem;
|
|
|
|
}
|
2019-09-25 08:24:16 +00:00
|
|
|
|
2019-10-31 07:47:54 +00:00
|
|
|
.select2-selection__choice__remove {
|
|
|
|
color: rgba(255, 255, 255, 0.7);
|
|
|
|
float: right;
|
|
|
|
margin-left: 5px;
|
|
|
|
margin-right: -2px;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: $white;
|
|
|
|
}
|
2019-09-25 08:24:16 +00:00
|
|
|
}
|
2019-08-20 10:48:22 +00:00
|
|
|
|
2019-10-31 07:47:54 +00:00
|
|
|
.text-sm &,
|
|
|
|
&.text-sm {
|
|
|
|
.select2-search.select2-search--inline {
|
|
|
|
.select2-search__field {
|
|
|
|
margin-top: 8px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.select2-selection__choice {
|
|
|
|
margin-top: .4rem;
|
|
|
|
}
|
|
|
|
}
|
2019-09-25 08:24:16 +00:00
|
|
|
}
|
2015-10-31 21:00:16 +00:00
|
|
|
|
2020-03-13 16:41:13 +00:00
|
|
|
&.select2-container--focus {
|
|
|
|
.select2-selection--single,
|
|
|
|
.select2-selection--multiple {
|
|
|
|
border-color: $input-focus-border-color;
|
|
|
|
}
|
2019-09-25 08:24:16 +00:00
|
|
|
|
2019-10-31 07:47:54 +00:00
|
|
|
.select2-search__field {
|
|
|
|
border: 0;
|
2019-09-25 08:24:16 +00:00
|
|
|
}
|
2019-08-20 10:48:22 +00:00
|
|
|
}
|
|
|
|
}
|
2015-10-31 21:00:16 +00:00
|
|
|
|
2019-08-20 10:48:22 +00:00
|
|
|
& .select2-selection--single .select2-selection__rendered li {
|
|
|
|
padding-right: 10px;
|
2015-10-31 21:00:16 +00:00
|
|
|
}
|
2019-10-23 06:46:37 +00:00
|
|
|
|
|
|
|
.input-group-prepend ~ & {
|
|
|
|
.select2-selection {
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.input-group > &:not(:last-child) {
|
|
|
|
.select2-selection {
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
}
|
|
|
|
}
|
2019-09-25 08:24:16 +00:00
|
|
|
}
|
|
|
|
|
2019-10-24 08:04:55 +00:00
|
|
|
// Select2 Bootstrap4 Theme overrides
|
|
|
|
.select2-container--bootstrap4 {
|
|
|
|
&.select2-container--focus .select2-selection {
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
}
|
2019-09-25 08:24:16 +00:00
|
|
|
|
2020-02-21 14:09:02 +00:00
|
|
|
// text-sm / form-control-sm override
|
|
|
|
select.form-control-sm ~ {
|
|
|
|
.select2-container--default {
|
2022-01-09 21:18:50 +00:00
|
|
|
font-size: 75%;
|
2020-02-21 14:09:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.text-sm,
|
|
|
|
select.form-control-sm ~ {
|
2020-02-13 13:07:05 +00:00
|
|
|
.select2-container--default {
|
|
|
|
.select2-selection--single {
|
|
|
|
height: $input-height-sm;
|
2020-06-02 09:15:14 +00:00
|
|
|
|
2020-02-13 13:07:05 +00:00
|
|
|
.select2-selection__rendered {
|
|
|
|
margin-top: -.4rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.select2-selection__arrow {
|
|
|
|
top: -.12rem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.select2-selection--multiple {
|
|
|
|
min-height: $input-height-sm;
|
2020-06-02 09:15:14 +00:00
|
|
|
|
2020-02-13 13:07:05 +00:00
|
|
|
.select2-selection__rendered {
|
|
|
|
padding: 0 $input-padding-x-sm / 2 $input-padding-y-sm;
|
|
|
|
margin-top: -($input-padding-x-sm / 5);
|
|
|
|
|
|
|
|
li:first-child.select2-search.select2-search--inline {
|
|
|
|
margin-left: $input-padding-x-sm / 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
.select2-search.select2-search--inline {
|
|
|
|
.select2-search__field {
|
|
|
|
margin-top: 6px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-16 23:05:53 +00:00
|
|
|
// Dropdown Fix inside maximized card
|
|
|
|
.maximized-card .select2-dropdown {
|
|
|
|
z-index: 9999;
|
|
|
|
}
|
|
|
|
|
2019-09-25 08:24:16 +00:00
|
|
|
// Background colors (theme colors)
|
|
|
|
@each $name, $color in $theme-colors {
|
|
|
|
@include select2-variant($name, $color);
|
|
|
|
}
|
2015-10-31 21:00:16 +00:00
|
|
|
|
2019-09-25 08:24:16 +00:00
|
|
|
// Background colors (colors)
|
|
|
|
@each $name, $color in $colors {
|
|
|
|
@include select2-variant($name, $color);
|
2015-10-31 21:00:16 +00:00
|
|
|
}
|
2020-09-23 14:08:15 +00:00
|
|
|
|
2021-04-15 13:12:26 +00:00
|
|
|
@include dark-mode () {
|
2020-09-23 14:08:15 +00:00
|
|
|
.select2-selection {
|
|
|
|
background-color: $dark;
|
|
|
|
border-color: $gray-600;
|
|
|
|
}
|
|
|
|
|
|
|
|
.select2-container--disabled .select2-selection--single {
|
|
|
|
background-color: lighten($dark, 7.5%);
|
|
|
|
}
|
|
|
|
|
|
|
|
.select2-selection--single {
|
|
|
|
background-color: $dark;
|
|
|
|
border-color: $gray-600;
|
|
|
|
|
|
|
|
.select2-selection__rendered {
|
|
|
|
color: $white;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.select2-dropdown .select2-search__field,
|
|
|
|
.select2-search--inline .select2-search__field {
|
|
|
|
background-color: $dark;
|
|
|
|
border-color: $gray-600;
|
|
|
|
color: white;
|
|
|
|
}
|
|
|
|
.select2-dropdown {
|
|
|
|
background-color: $dark;
|
|
|
|
border-color: $gray-600;
|
|
|
|
color: white;
|
|
|
|
}
|
|
|
|
.select2-results__option[aria-selected="true"] {
|
|
|
|
background-color: lighten($dark, 5%) !important;
|
|
|
|
color: $gray-300;
|
|
|
|
}
|
|
|
|
.select2-container .select2-search--inline .select2-search__field {
|
|
|
|
background-color: transparent;
|
|
|
|
color: $white;
|
|
|
|
}
|
|
|
|
|
|
|
|
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
|
|
|
|
color: $white;
|
|
|
|
}
|
2021-03-09 19:44:26 +00:00
|
|
|
|
|
|
|
// Background colors (theme colors)
|
|
|
|
@each $name, $color in $theme-colors-alt {
|
|
|
|
@include select2-variant($name, $color);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Background colors (colors)
|
|
|
|
@each $name, $color in $colors-alt {
|
|
|
|
@include select2-variant($name, $color);
|
|
|
|
}
|
2020-09-23 14:08:15 +00:00
|
|
|
}
|