_select2.scss 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. //
  2. // Plugin: Select2
  3. //
  4. //Signle select
  5. .select2-container--default,
  6. .select2-selection {
  7. &.select2-container--focus,
  8. &:focus,
  9. &:active {
  10. outline: none;
  11. }
  12. .select2-selection--single {
  13. border: 1px solid $gray-x-light;
  14. //border-radius: $input-radius;
  15. padding: 6px 12px;
  16. height: $input-height;
  17. }
  18. }
  19. .select2-container--default {
  20. &.select2-container--open {
  21. border-color: theme-color("primary");
  22. }
  23. & .select2-dropdown {
  24. border: 1px solid $gray-x-light;
  25. //border-radius: $input-radius;
  26. }
  27. & .select2-results__option--highlighted[aria-selected] {
  28. background-color: theme-color("primary");
  29. color: white;
  30. }
  31. & .select2-results__option {
  32. padding: 6px 12px;
  33. user-select: none;
  34. -webkit-user-select: none;
  35. }
  36. & .select2-selection--single .select2-selection__rendered {
  37. padding-left: 0;
  38. padding-right: 0;
  39. height: auto;
  40. margin-top: -3px;
  41. }
  42. &[dir="rtl"] .select2-selection--single .select2-selection__rendered {
  43. padding-right: 6px;
  44. padding-left: 20px;
  45. }
  46. & .select2-selection--single .select2-selection__arrow {
  47. height: 31px;
  48. right: 6px;
  49. }
  50. & .select2-selection--single .select2-selection__arrow b {
  51. margin-top: 0;
  52. }
  53. .select2-dropdown,
  54. .select2-search--inline {
  55. .select2-search__field {
  56. border: 1px solid $gray-x-light;
  57. &:focus {
  58. outline: none;
  59. border: 1px solid theme-color("primary");
  60. }
  61. }
  62. }
  63. & .select2-results__option[aria-disabled=true] {
  64. color: #999;
  65. }
  66. & .select2-results__option[aria-selected=true] {
  67. background-color: #ddd;
  68. &,
  69. &:hover {
  70. color: #444;
  71. }
  72. }
  73. //Multiple select
  74. & {
  75. .select2-selection--multiple {
  76. min-height: $input-height;
  77. border: 1px solid $gray-x-light;
  78. //border-radius: $input-radius;
  79. &:focus {
  80. border-color: theme-color("primary");
  81. }
  82. .select2-selection__rendered li:first-child.select2-search.select2-search--inline {
  83. width: 100%;
  84. .select2-search__field {
  85. width: 100% !important;
  86. }
  87. }
  88. }
  89. &.select2-container--focus .select2-selection--multiple {
  90. border-color: $gray-x-light;
  91. }
  92. }
  93. & .select2-selection--multiple .select2-selection__choice {
  94. background-color: theme-color("primary");
  95. border-color: darken(theme-color("primary"), 5%);
  96. padding: 0 10px;
  97. color: $white;
  98. }
  99. & .select2-selection--multiple .select2-selection__choice__remove {
  100. margin-right: 5px;
  101. color: rgba(255, 255, 255, 0.7);
  102. &:hover {
  103. color: $white;
  104. }
  105. }
  106. & .select2-selection--single .select2-selection__rendered li {
  107. padding-right: 10px;
  108. }
  109. }