select2.less 2.8 KB

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