select2.less 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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;
  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;
  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;
  62. &:focus {
  63. outline: none;
  64. border: 1px solid @light-blue;
  65. }
  66. }
  67. }
  68. .select2-container--default .select2-results__option[aria-disabled=true] {
  69. color: #999;
  70. }
  71. .select2-container--default .select2-results__option[aria-selected=true] {
  72. background-color: #ddd;
  73. &,
  74. &:hover {
  75. color: #444;
  76. }
  77. }
  78. //Multiple select
  79. .select2-container--default {
  80. .select2-selection--multiple {
  81. border: 1px solid @gray;
  82. border-radius: @input-radius;
  83. &:focus {
  84. border-color: @light-blue;
  85. }
  86. }
  87. &.select2-container--focus .select2-selection--multiple {
  88. border-color: @gray;
  89. }
  90. }
  91. .select2-container--default .select2-selection--multiple .select2-selection__choice {
  92. background-color: @light-blue;
  93. border-color: darken(@light-blue, 5%);
  94. padding: 1px 10px;
  95. color: #fff;
  96. }
  97. .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  98. margin-right: 5px;
  99. color: rgba(255, 255, 255, .7);
  100. &:hover {
  101. color: #fff;
  102. }
  103. }
  104. .select2-container .select2-selection--single .select2-selection__rendered {
  105. padding-right: 10px;
  106. }