select2-bootstrap.css 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. /**
  2. * Select2 Bootstrap CSS
  3. * Compatible with Select2 3.3.2, 3.4.1, 3.4.2 and Twitter Bootstrap 3.0.0
  4. * MIT License
  5. */
  6. /**
  7. * Reset Bootstrap 3 .form-control styles which - if applied to the
  8. * original <select>-element the Select2-plugin may be run against -
  9. * are copied to the .select2-container.
  10. *
  11. * 1. Overwrite .select2-container's original display:inline-block
  12. * with Bootstrap 3's default for .form-control, display:block;
  13. * courtesy of @juristr (@see https://github.com/fk/select2-bootstrap-css/pull/1)
  14. */
  15. .select2-container.form-control {
  16. background: transparent;
  17. border: none;
  18. display: block;
  19. /* 1 */
  20. margin: 0;
  21. padding: 0;
  22. }
  23. /**
  24. * Adjust Select2 inputs to fit Bootstrap 3 default .form-control appearance.
  25. */
  26. .select2-container .select2-choices .select2-search-field input,
  27. .select2-container .select2-choice,
  28. .select2-container .select2-choices {
  29. background: none;
  30. padding: 0;
  31. border-color: #cccccc;
  32. border-radius: 4px;
  33. color: #555555;
  34. font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  35. background-color: white;
  36. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  37. -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  38. box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  39. }
  40. .select2-search input {
  41. border-color: #cccccc;
  42. border-radius: 4px;
  43. color: #555555;
  44. font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  45. background-color: white;
  46. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  47. -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  48. box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  49. }
  50. .select2-container .select2-choices .select2-search-field input {
  51. -webkit-box-shadow: none;
  52. box-shadow: none;
  53. }
  54. /**
  55. * Adjust Select2 input heights to match the Bootstrap default.
  56. */
  57. .select2-container .select2-choice {
  58. height: 30px;
  59. line-height: 1.42857;
  60. }
  61. /**
  62. * Address Multi Select2's height which - depending on how many elements have been selected -
  63. * may grown higher than their initial size.
  64. */
  65. .select2-container.select2-container-multi.form-control {
  66. height: auto;
  67. }
  68. /**
  69. * Address Bootstrap 3 control sizing classes
  70. * @see http://getbootstrap.com/css/#forms-control-sizes
  71. */
  72. .select2-container.input-sm .select2-choice,
  73. .input-group-sm .select2-container .select2-choice {
  74. height: 30px;
  75. line-height: 1.5;
  76. border-radius: 3px;
  77. }
  78. .select2-container.input-lg .select2-choice,
  79. .input-group-lg .select2-container .select2-choice {
  80. height: 45px;
  81. line-height: 1.33;
  82. border-radius: 6px;
  83. }
  84. .select2-container-multi .select2-choices .select2-search-field input {
  85. height: 32px;
  86. }
  87. .select2-container-multi.input-sm .select2-choices .select2-search-field input,
  88. .input-group-sm .select2-container-multi .select2-choices .select2-search-field input {
  89. height: 28px;
  90. }
  91. .select2-container-multi.input-lg .select2-choices .select2-search-field input,
  92. .input-group-lg .select2-container-multi .select2-choices .select2-search-field input {
  93. height: 43px;
  94. }
  95. /**
  96. * Adjust height and line-height for .select2-search-field amd multi-select Select2 widgets.
  97. *
  98. * 1. Class repetition to address missing .select2-chosen in Select2 < 3.3.2.
  99. */
  100. .select2-container-multi .select2-choices .select2-search-field input {
  101. margin: 0;
  102. }
  103. .select2-chosen,
  104. .select2-choice > span:first-child,
  105. .select2-container .select2-choices .select2-search-field input {
  106. padding: 6px 12px;
  107. }
  108. .input-sm .select2-chosen,
  109. .input-group-sm .select2-chosen,
  110. .input-sm .select2-choice > span:first-child,
  111. .input-group-sm .select2-choice > span:first-child,
  112. .input-sm .select2-choices .select2-search-field input,
  113. .input-group-sm .select2-choices .select2-search-field input {
  114. padding: 5px 10px;
  115. }
  116. .input-lg .select2-chosen,
  117. .input-group-lg .select2-chosen,
  118. .input-lg .select2-choice > span:first-child,
  119. .input-group-lg .select2-choice > span:first-child,
  120. .input-lg .select2-choices .select2-search-field input,
  121. .input-group-lg .select2-choices .select2-search-field input {
  122. padding: 10px 16px;
  123. }
  124. .select2-container-multi .select2-choices .select2-search-choice {
  125. margin-top: 5px;
  126. margin-bottom: 3px;
  127. }
  128. .select2-container-multi.input-sm .select2-choices .select2-search-choice,
  129. .input-group-sm .select2-container-multi .select2-choices .select2-search-choice {
  130. margin-top: 3px;
  131. margin-bottom: 2px;
  132. }
  133. .select2-container-multi.input-lg .select2-choices .select2-search-choice,
  134. .input-group-lg .select2-container-multi .select2-choices .select2-search-choice {
  135. line-height: 24px;
  136. }
  137. /**
  138. * Adjust the single Select2's dropdown arrow button appearance.
  139. *
  140. * 1. For Select2 v.3.3.2.
  141. */
  142. .select2-container .select2-choice .select2-arrow,
  143. .select2-container .select2-choice div {
  144. border-left: none;
  145. background: none;
  146. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  147. }
  148. .select2-dropdown-open .select2-choice .select2-arrow,
  149. .select2-dropdown-open .select2-choice div {
  150. border-left-color: transparent;
  151. background: none;
  152. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  153. }
  154. /**
  155. * Adjust the dropdown arrow button icon position for the single-select Select2 elements
  156. * to make it line up vertically now that we increased the height of .select2-container.
  157. *
  158. * 1. Class repetition to address missing .select2-chosen in Select2 v.3.3.2.
  159. */
  160. .select2-container .select2-choice .select2-arrow b,
  161. .select2-container .select2-choice div b {
  162. background-position: 0 3px;
  163. }
  164. .select2-dropdown-open .select2-choice .select2-arrow b,
  165. .select2-dropdown-open .select2-choice div b {
  166. background-position: -18px 3px;
  167. }
  168. .select2-container.input-sm .select2-choice .select2-arrow b,
  169. .input-group-sm .select2-container .select2-choice .select2-arrow b,
  170. .select2-container.input-sm .select2-choice div b,
  171. .input-group-sm .select2-container .select2-choice div b {
  172. background-position: 0 1px;
  173. }
  174. .select2-dropdown-open.input-sm .select2-choice .select2-arrow b,
  175. .input-group-sm .select2-dropdown-open .select2-choice .select2-arrow b,
  176. .select2-dropdown-open.input-sm .select2-choice div b,
  177. .input-group-sm .select2-dropdown-open .select2-choice div b {
  178. background-position: -18px 1px;
  179. }
  180. .select2-container.input-lg .select2-choice .select2-arrow b,
  181. .input-group-lg .select2-container .select2-choice .select2-arrow b,
  182. .select2-container.input-lg .select2-choice div b,
  183. .input-group-lg .select2-container .select2-choice div b {
  184. background-position: 0 9px;
  185. }
  186. .select2-dropdown-open.input-lg .select2-choice .select2-arrow b,
  187. .input-group-lg .select2-dropdown-open .select2-choice .select2-arrow b,
  188. .select2-dropdown-open.input-lg .select2-choice div b,
  189. .input-group-lg .select2-dropdown-open .select2-choice div b {
  190. background-position: -18px 9px;
  191. }
  192. /**
  193. * Address Bootstrap's validation states and change Select2's border colors and focus states.
  194. * Apply .has-warning, .has-danger or .has-succes to #select2-drop to match Bootstraps' colors.
  195. */
  196. .has-warning .select2-choice,
  197. .has-warning .select2-choices {
  198. border-color: #c09853;
  199. }
  200. .has-warning .select2-container-active .select2-choice,
  201. .has-warning .select2-container-multi.select2-container-active .select2-choices {
  202. border-color: #a47e3c;
  203. -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
  204. box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
  205. }
  206. .has-warning.select2-drop-active {
  207. border-color: #a47e3c;
  208. }
  209. .has-warning.select2-drop-active.select2-drop.select2-drop-above {
  210. border-top-color: #a47e3c;
  211. }
  212. .has-error .select2-choice,
  213. .has-error .select2-choices {
  214. border-color: #b94a48;
  215. }
  216. .has-error .select2-container-active .select2-choice,
  217. .has-error .select2-container-multi.select2-container-active .select2-choices {
  218. border-color: #953b39;
  219. -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
  220. box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
  221. }
  222. .has-error.select2-drop-active {
  223. border-color: #953b39;
  224. }
  225. .has-error.select2-drop-active.select2-drop.select2-drop-above {
  226. border-top-color: #953b39;
  227. }
  228. .has-success .select2-choice,
  229. .has-success .select2-choices {
  230. border-color: #468847;
  231. }
  232. .has-success .select2-container-active .select2-choice,
  233. .has-success .select2-container-multi.select2-container-active .select2-choices {
  234. border-color: #356635;
  235. -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
  236. box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
  237. }
  238. .has-success.select2-drop-active {
  239. border-color: #356635;
  240. }
  241. .has-success.select2-drop-active.select2-drop.select2-drop-above {
  242. border-top-color: #356635;
  243. }
  244. /**
  245. * Make Select2's active-styles - applied to .select2-container when the widget receives focus -
  246. * fit Bootstrap 3's .form-element:focus appearance.
  247. */
  248. .select2-container-active .select2-choice,
  249. .select2-container-multi.select2-container-active .select2-choices {
  250. border-color: #66afe9;
  251. outline: none;
  252. -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
  253. box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
  254. -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
  255. transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
  256. }
  257. .select2-drop-active {
  258. border-color: #66afe9;
  259. }
  260. .select2-drop-auto-width,
  261. .select2-drop.select2-drop-above.select2-drop-active {
  262. border-top-color: #66afe9;
  263. }
  264. /**
  265. * Select2 widgets in Bootstrap Input Groups
  266. *
  267. * When Select2 widgets are combined with other elements using Bootstrap 3's
  268. * "Input Group" component, we don't want specific edges of the Select2 container
  269. * to have a border-radius.
  270. *
  271. * In Bootstrap 2, input groups required a markup where these style adjustments
  272. * could be bound to a CSS-class identifying if the additional elements are appended,
  273. * prepended or both.
  274. *
  275. * Bootstrap 3 doesn't rely on these classes anymore, so we have to use our own.
  276. * Use .select2-bootstrap-prepend and .select2-bootstrap-append on a Bootstrap 3 .input-group
  277. * to let the contained Select2 widget know which edges should not be rounded as they are
  278. * directly followed by another element.
  279. *
  280. * @see http://getbootstrap.com/components/#input-groups
  281. */
  282. .input-group.select2-bootstrap-prepend [class^="select2-choice"] {
  283. border-bottom-left-radius: 0 !important;
  284. border-top-left-radius: 0 !important;
  285. }
  286. .input-group.select2-bootstrap-append [class^="select2-choice"] {
  287. border-bottom-right-radius: 0 !important;
  288. border-top-right-radius: 0 !important;
  289. }
  290. .select2-dropdown-open [class^="select2-choice"] {
  291. border-bottom-right-radius: 0 !important;
  292. border-bottom-left-radius: 0 !important;
  293. }
  294. .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
  295. border-top-right-radius: 0 !important;
  296. border-top-left-radius: 0 !important;
  297. }
  298. /**
  299. * Adjust Select2's choices hover and selected styles to match Bootstrap 3's default dropdown styles.
  300. */
  301. .select2-results .select2-highlighted {
  302. color: white;
  303. background-color: #428bca;
  304. }
  305. /**
  306. * Adjust alignment of Bootstrap 3 buttons in Bootstrap 3 Input Groups to address
  307. * Multi Select2's height which - depending on how many elements have been selected -
  308. * may grown higher than their initial size.
  309. */
  310. .select2-bootstrap-append .select2-container-multiple,
  311. .select2-bootstrap-append .input-group-btn,
  312. .select2-bootstrap-append .input-group-btn .btn,
  313. .select2-bootstrap-prepend .select2-container-multiple,
  314. .select2-bootstrap-prepend .input-group-btn,
  315. .select2-bootstrap-prepend .input-group-btn .btn {
  316. vertical-align: top;
  317. }
  318. /**
  319. * Make Multi Select2's choices match Bootstrap 3's default button styles.
  320. */
  321. .select2-container-multi .select2-choices .select2-search-choice {
  322. color: #555555;
  323. background: white;
  324. border-color: #cccccc;
  325. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  326. -webkit-box-shadow: none;
  327. box-shadow: none;
  328. }
  329. .select2-container-multi .select2-choices .select2-search-choice-focus {
  330. background: #ebebeb;
  331. border-color: #adadad;
  332. color: #333333;
  333. -webkit-box-shadow: none;
  334. box-shadow: none;
  335. }
  336. /**
  337. * Address Multi Select2's choice close-button vertical alignment.
  338. */
  339. .select2-search-choice-close {
  340. margin-top: -7px;
  341. top: 50%;
  342. }
  343. /**
  344. * Adjust the single Select2's clear button position (used to reset the select box
  345. * back to the placeholder value and visible once a selection is made
  346. * activated by Select2's "allowClear" option).
  347. */
  348. .select2-container .select2-choice abbr {
  349. top: 50%;
  350. }
  351. /**
  352. * Adjust "no results" and "selection limit" messages to make use
  353. * of Bootstrap 3's default "Alert" style.
  354. *
  355. * @see http://getbootstrap.com/components/#alerts-default
  356. */
  357. .select2-results .select2-no-results,
  358. .select2-results .select2-searching,
  359. .select2-results .select2-selection-limit {
  360. background-color: #fcf8e3;
  361. color: #c09853;
  362. }
  363. /**
  364. * Address disabled Select2 styles.
  365. *
  366. * 1. For Select2 v.3.3.2.
  367. * 2. Revert border-left:0 inherited from Select2's CSS to prevent the arrow
  368. * from jumping when switching from disabled to enabled state and vice versa.
  369. */
  370. .select2-container.select2-container-disabled .select2-choice,
  371. .select2-container.select2-container-disabled .select2-choices {
  372. cursor: not-allowed;
  373. background-color: #eeeeee;
  374. border-color: #cccccc;
  375. }
  376. .select2-container.select2-container-disabled .select2-choice .select2-arrow,
  377. .select2-container.select2-container-disabled .select2-choice div,
  378. .select2-container.select2-container-disabled .select2-choices .select2-arrow,
  379. .select2-container.select2-container-disabled .select2-choices div {
  380. background-color: transparent;
  381. border-left: 1px solid transparent;
  382. /* 2 */
  383. }
  384. /**
  385. * Address Select2's loading indicator position - which should not stick
  386. * to the right edge of Select2's search input.
  387. *
  388. * 1. in .select2-search input
  389. * 2. in Multi Select2's .select2-search-field input
  390. * 3. in the status-message of infinite-scroll with remote data (@see http://ivaynberg.github.io/select2/#infinite)
  391. *
  392. * These styles alter Select2's default background-position of 100%
  393. * and supply the new background-position syntax to browsers which support it:
  394. *
  395. * 1. Android, Safari < 6/Mobile, IE<9: change to a relative background-position of 99%
  396. * 2. Chrome 25+, Firefox 13+, IE 9+, Opera 10.5+: use the new CSS3-background-position syntax
  397. *
  398. * @see http://www.w3.org/TR/css3-background/#background-position
  399. *
  400. * @todo Since both Select2 and Bootstrap 3 only support IE8 and above,
  401. * we could use the :after-pseudo-element to display the loading indicator.
  402. * Alternatively, we could supply an altered loading indicator image which already
  403. * contains an offset to the right.
  404. */
  405. .select2-search input.select2-active,
  406. .select2-container-multi .select2-choices .select2-search-field input.select2-active,
  407. .select2-more-results.select2-active {
  408. background-position: 99%;
  409. /* 4 */
  410. background-position: right 4px center;
  411. /* 5 */
  412. }