thirdparty-select2.less 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. .enable_plugin_select2() when(@enable-plugin-select2 = true) {
  2. .select2-container .select2-choice {
  3. .border-radius(0);
  4. height: 32px;
  5. line-height: 28px;
  6. }
  7. .select2-container.select2-drop-above .select2-choice {
  8. .border-radius(0);
  9. }
  10. .select2-container[class*="input-"] {
  11. max-width: none;
  12. }
  13. .select2-container.input-mini {
  14. min-width: 100px;
  15. }
  16. .select2-container .select2-choice abbr , .select2-search-choice-close {
  17. background: none;
  18. &:before {
  19. font-family: FontAwesome;
  20. font-size: @base-font-size - 1;
  21. display: inline;
  22. content: "\f00d";
  23. color: #888;
  24. position: relative;
  25. top: -1px;
  26. }
  27. &:hover:before {
  28. color:#555;
  29. }
  30. }
  31. .select2-container .select2-choice abbr:before {
  32. top:-7px;
  33. }
  34. .select2-search-choice-close:hover {
  35. text-decoration:none !important;
  36. }
  37. .select2-drop {
  38. .border-radius(0);
  39. border:1px solid #4492C9;
  40. border-width:0 1px 3px;
  41. }
  42. .select2-drop.select2-drop-above {
  43. .border-radius(0);
  44. }
  45. .select2-container .select2-choice {
  46. background:#FAFAFA none;
  47. }
  48. .select2-container-active .select2-choice,
  49. .select2-container-active .select2-choices,
  50. .select2-dropdown-open.select2-drop-above .select2-choice,
  51. .select2-dropdown-open.select2-drop-above .select2-choices,
  52. .select2-container-multi.select2-container-active .select2-choices
  53. {
  54. border-color:#4492C9;
  55. }
  56. .select2-results .select2-highlighted {
  57. background: #316AC5;
  58. }
  59. .select2-container .select2-choice .select2-arrow {
  60. .border-radius(0);
  61. background:transparent none;
  62. border:none;
  63. }
  64. .select2-container .select2-choice .select2-arrow b {
  65. background: none;
  66. &:before {
  67. font-family: FontAwesome;
  68. font-size: @base-font-size - 1;
  69. display: inline;
  70. content: "\f0d7";
  71. color: #888;
  72. position: relative;
  73. left: 5px;
  74. }
  75. }
  76. .select2-dropdown-open .select2-choice .select2-arrow b:before {
  77. content:"\f0d8";
  78. }
  79. .select2-search {
  80. .select2-input {
  81. background: #fff none;
  82. margin-top:4px;
  83. }
  84. &:after {
  85. font-family: FontAwesome;
  86. font-size: @base-font-size + 1;
  87. display: inline;
  88. content: "\f002";
  89. color: #777;
  90. position: relative;
  91. top: 0;
  92. left: -20px;
  93. z-index: 0;
  94. }
  95. }
  96. .select2-dropdown-open.select2-drop-above .select2-choice, .select2-dropdown-open.select2-drop-above .select2-choices
  97. {
  98. background-image: none;
  99. background-color: #F6F6F6;
  100. }
  101. .select2-container-multi .select2-choices .select2-search-field input {
  102. border: none !important;
  103. .box-shadow(none) !important;
  104. background: none !important;
  105. font-size: @font-size-text-input;
  106. }
  107. .select2-container-multi .select2-choices .select2-search-choice {
  108. line-height: 16px;
  109. padding-bottom: 4px;
  110. }
  111. .select2-container-active .select2-choice,
  112. .select2-container-active .select2-choices,
  113. .select2-container-multi.select2-container-active .select2-choices,
  114. .select2-dropdown-open.select2-drop-above .select2-choice,
  115. .select2-dropdown-open.select2-drop-above .select2-choices
  116. {
  117. .box-shadow(none);
  118. }
  119. .select2-search input.select2-active {
  120. background-color:#FFF;
  121. position: relative;
  122. z-index: 1;//so it will be on top of search icon
  123. }
  124. @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) {
  125. .select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
  126. background-image: none !important;
  127. background-size: auto !important;
  128. }
  129. .select2-search input {
  130. background-position: auto !important;
  131. }
  132. }
  133. .select2-container-active.select2-dropdown-open {
  134. .select2-choice {
  135. #gradient > .vertical(#EEEEEE , #FFFFFF);
  136. }
  137. }
  138. .select2-container-active.select2-drop-above {
  139. .select2-choice {
  140. #gradient > .vertical(#FFFFFF , #EEEEEE);
  141. }
  142. }
  143. .select2-choice , .select2-choices {
  144. .form-group.has-error & {
  145. border-color:@error-state-border !important;
  146. }
  147. .form-group.has-info & {
  148. border-color:@info-state-border !important;
  149. }
  150. .form-group.has-warning & {
  151. border-color:@warning-state-border !important;
  152. }
  153. .form-group.has-success & {
  154. border-color:@success-state-border !important;
  155. }
  156. }
  157. @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) {
  158. .select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice .select2-arrow b {
  159. background-image: none !important;
  160. background-repeat: no-repeat !important;
  161. background-size: auto !important;
  162. }
  163. .select2-search input {
  164. background-position: auto !important;
  165. }
  166. }
  167. //a second style (like tag inpit)
  168. .enable_plugin_select2_style_2() when(@enable-plugin-select2-style-2 = true) {
  169. .select2-container-multi.tag-input-style {
  170. .select2-choices .select2-search-choice {
  171. background-image:none;
  172. background-color:@tag-bg;
  173. color: #FFFFFF;
  174. display: inline-block;
  175. font-size: @base-font-size;
  176. font-weight: normal;
  177. margin-bottom: 3px;
  178. margin-right: 0;
  179. padding: 6px 22px 7px 9px;
  180. position: relative;
  181. text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.15);
  182. transition: all 0.2s ease 0s;
  183. vertical-align: baseline;
  184. white-space: nowrap;
  185. border:none;
  186. .box-shadow(none);
  187. .border-radius(0);
  188. .select2-search-choice-close {
  189. position: absolute;
  190. top:0;
  191. bottom:0;
  192. right:0;
  193. left: auto;
  194. width: 18px;
  195. height: auto;
  196. line-height: 25px;
  197. text-align: center;
  198. &:before {
  199. color: #FFF;
  200. position: static;
  201. font-size: @base-font-size - 2;
  202. }
  203. &:hover {
  204. background-color:rgba(0,0,0,0.2);
  205. &:before {
  206. color:#FFF;
  207. }
  208. }
  209. }
  210. }
  211. }
  212. }
  213. .enable_plugin_select2_style_2();
  214. }
  215. .enable_plugin_select2();