select2.less 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. @import url('./variables.less');
  2. @import './shared/forms.less';
  3. @import (reference) './includes/bootstrap/mixins.less';
  4. .select2-container {
  5. margin: 0;
  6. position: relative;
  7. display: inline-block;
  8. /* inline-block for ie7 */
  9. zoom: 1;
  10. *display: inline;
  11. vertical-align: middle;
  12. .form-control;
  13. display: inline-block;
  14. padding: 4px 10px 3px;
  15. }
  16. .select2-container,
  17. .select2-drop,
  18. .select2-search,
  19. .select2-search input {
  20. /*
  21. Force border-box so that % widths fit the parent
  22. container without overlap because of margin/padding.
  23. More Info : http://www.quirksmode.org/css/box.html
  24. */
  25. -webkit-box-sizing: border-box; /* webkit */
  26. -moz-box-sizing: border-box; /* firefox */
  27. box-sizing: border-box; /* css3 */
  28. }
  29. .select2-container .select2-choice {
  30. display: block;
  31. overflow: hidden;
  32. position: relative;
  33. white-space: nowrap;
  34. text-decoration: none;
  35. border-radius: 4px;
  36. background-clip: padding-box;
  37. -webkit-touch-callout: none;
  38. -webkit-user-select: none;
  39. -moz-user-select: none;
  40. -ms-user-select: none;
  41. user-select: none;
  42. color: @gray-dark;
  43. &.select2-default {
  44. color: @gray-light;
  45. }
  46. }
  47. html[dir='rtl'] .select2-container .select2-choice {
  48. padding: 0 8px 0 0;
  49. }
  50. .select2-container.select2-drop-above .select2-choice {
  51. border-bottom-color: #aaa;
  52. border-radius: 0 0 4px 4px;
  53. }
  54. .select2-container.select2-allowclear .select2-choice .select2-chosen {
  55. margin-right: 42px;
  56. }
  57. .select2-container .select2-choice > .select2-chosen {
  58. margin-right: 26px;
  59. display: block;
  60. overflow: hidden;
  61. white-space: nowrap;
  62. text-overflow: ellipsis;
  63. float: none;
  64. width: auto;
  65. }
  66. html[dir='rtl'] .select2-container .select2-choice > .select2-chosen {
  67. margin-left: 26px;
  68. margin-right: 0;
  69. }
  70. .select2-container .select2-choice abbr {
  71. display: none;
  72. width: 12px;
  73. height: 12px;
  74. position: absolute;
  75. right: 18px;
  76. font-family: 'sentry-simple';
  77. speak: none;
  78. font-style: normal;
  79. font-weight: normal;
  80. font-variant: normal;
  81. text-transform: none;
  82. line-height: 1;
  83. &:before {
  84. content: '\e043';
  85. }
  86. }
  87. .select2-container.select2-allowclear .select2-choice abbr {
  88. display: inline-block;
  89. }
  90. .select2-container .select2-choice abbr:hover {
  91. background-position: right -11px;
  92. cursor: pointer;
  93. }
  94. .select2-drop-mask {
  95. border: 0;
  96. margin: 0;
  97. padding: 0;
  98. position: fixed;
  99. left: 0;
  100. top: 0;
  101. min-height: 100%;
  102. min-width: 100%;
  103. height: auto;
  104. width: auto;
  105. opacity: 0;
  106. z-index: 9998;
  107. /* styles required for IE to work */
  108. background-color: #fff;
  109. }
  110. .select2-drop {
  111. width: 100%;
  112. margin-top: -2px;
  113. position: absolute;
  114. z-index: 9999;
  115. top: 100%;
  116. background: #fff;
  117. border-radius: 0 0 3px 3px;
  118. }
  119. .select2-drop.select2-drop-above {
  120. margin-top: 1px;
  121. border-top: 1px solid lighten(@gray-lighter, 10);
  122. border-bottom: 0;
  123. border-radius: 3px 3px 0 0;
  124. }
  125. .select2-drop-active {
  126. border: 1px solid lighten(@gray-lighter, 10);
  127. border-top: none;
  128. }
  129. .select2-drop.select2-drop-above.select2-drop-active {
  130. border-top: 1px solid #ccc;
  131. }
  132. .select2-drop-auto-width {
  133. border-top: 1px solid #aaa;
  134. width: auto;
  135. }
  136. .select2-drop-auto-width .select2-search {
  137. padding-top: 4px;
  138. }
  139. .select2-container .select2-choice .select2-arrow {
  140. display: inline-block;
  141. width: 18px;
  142. height: 100%;
  143. position: absolute;
  144. right: -5px;
  145. top: -20px;
  146. &:after {
  147. font-family: 'sentry-simple';
  148. font-size: 16px;
  149. content: '\e60f';
  150. display: block;
  151. }
  152. }
  153. .select2-active .select2-arrow {
  154. &:after {
  155. content: '\e610';
  156. }
  157. }
  158. html[dir='rtl'] .select2-container .select2-choice .select2-arrow {
  159. left: 0;
  160. right: auto;
  161. border-left: none;
  162. border-right: 1px solid #aaa;
  163. border-radius: 4px 0 0 4px;
  164. }
  165. .select2-container .select2-choice .select2-arrow b {
  166. display: block;
  167. width: 100%;
  168. height: 100%;
  169. }
  170. html[dir='rtl'] .select2-container .select2-choice .select2-arrow b {
  171. background-position: 2px 1px;
  172. }
  173. .select2-search {
  174. display: inline-block;
  175. width: 100%;
  176. min-height: 26px;
  177. margin: 0;
  178. padding-left: 4px;
  179. padding-right: 4px;
  180. position: relative;
  181. z-index: 10000;
  182. white-space: nowrap;
  183. }
  184. .select2-search input {
  185. width: 100%;
  186. height: auto !important;
  187. min-height: 22px;
  188. padding: 1px 20px 1px 6px;
  189. margin: 0;
  190. outline: 0;
  191. font-family: sans-serif;
  192. font-size: 1em;
  193. border: 1px solid lighten(@gray-lighter, 10);
  194. border-radius: 2px;
  195. -webkit-box-shadow: none;
  196. box-shadow: none;
  197. background: #fff;
  198. }
  199. html[dir='rtl'] .select2-search input {
  200. padding: 4px 5px 4px 20px;
  201. background: #fff;
  202. }
  203. .select2-drop.select2-drop-above .select2-search input {
  204. margin-top: 4px;
  205. }
  206. .select2-search input.select2-active {
  207. background: #fff;
  208. }
  209. .select2-container-active .select2-choice,
  210. .select2-container-active .select2-choices {
  211. }
  212. .select2-dropdown-open .select2-choice {
  213. border-bottom-color: transparent;
  214. border-bottom-left-radius: 0;
  215. border-bottom-right-radius: 0;
  216. }
  217. .select2-dropdown-open.select2-drop-above .select2-choice,
  218. .select2-dropdown-open.select2-drop-above .select2-choices {
  219. }
  220. .select2-dropdown-open .select2-choice .select2-arrow {
  221. background: transparent;
  222. border-left: none;
  223. filter: none;
  224. }
  225. html[dir='rtl'] .select2-dropdown-open .select2-choice .select2-arrow {
  226. border-right: none;
  227. }
  228. .select2-dropdown-open .select2-choice .select2-arrow b {
  229. background-position: -18px 1px;
  230. }
  231. html[dir='rtl'] .select2-dropdown-open .select2-choice .select2-arrow b {
  232. background-position: -16px 1px;
  233. }
  234. .select2-hidden-accessible {
  235. border: 0;
  236. clip: rect(0 0 0 0);
  237. height: 1px;
  238. margin: -1px;
  239. overflow: hidden;
  240. padding: 0;
  241. position: absolute;
  242. width: 1px;
  243. }
  244. /* results */
  245. .select2-results {
  246. max-height: 200px;
  247. padding: 0 0 0 4px;
  248. margin: 4px 4px 4px 0;
  249. position: relative;
  250. overflow-x: hidden;
  251. overflow-y: auto;
  252. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  253. font-size: 15px;
  254. color: @gray;
  255. border-radius: 0 0 3px 3px;
  256. line-height: 1.2;
  257. }
  258. html[dir='rtl'] .select2-results {
  259. padding: 0 4px 0 0;
  260. margin: 4px 0 4px 4px;
  261. }
  262. .select2-results ul.select2-result-sub {
  263. margin: 0;
  264. padding-left: 0;
  265. }
  266. .select2-results li {
  267. list-style: none;
  268. display: list-item;
  269. background-image: none;
  270. }
  271. .select2-results li.select2-result-with-children > .select2-result-label {
  272. font-weight: bold;
  273. }
  274. .select2-results .select2-result-label {
  275. padding: 3px 7px 4px;
  276. margin: 0;
  277. cursor: pointer;
  278. min-height: 1em;
  279. -webkit-touch-callout: none;
  280. -webkit-user-select: none;
  281. -moz-user-select: none;
  282. -ms-user-select: none;
  283. user-select: none;
  284. }
  285. .select2-results-dept-1 .select2-result-label {
  286. padding-left: 20px;
  287. }
  288. .select2-results-dept-2 .select2-result-label {
  289. padding-left: 40px;
  290. }
  291. .select2-results-dept-3 .select2-result-label {
  292. padding-left: 60px;
  293. }
  294. .select2-results-dept-4 .select2-result-label {
  295. padding-left: 80px;
  296. }
  297. .select2-results-dept-5 .select2-result-label {
  298. padding-left: 100px;
  299. }
  300. .select2-results-dept-6 .select2-result-label {
  301. padding-left: 110px;
  302. }
  303. .select2-results-dept-7 .select2-result-label {
  304. padding-left: 120px;
  305. }
  306. .select2-results .select2-highlighted {
  307. background: @purple;
  308. color: #fff;
  309. }
  310. .select2-results li em {
  311. background: #feffde;
  312. font-style: normal;
  313. }
  314. .select2-results .select2-highlighted em {
  315. background: transparent;
  316. }
  317. .select2-results .select2-highlighted ul {
  318. background: #fff;
  319. color: #000;
  320. }
  321. .select2-results .select2-no-results,
  322. .select2-results .select2-searching,
  323. .select2-results .select2-ajax-error,
  324. .select2-results .select2-selection-limit {
  325. background: @white-darker;
  326. display: list-item;
  327. padding-left: 5px;
  328. font-size: 14px;
  329. text-align: center;
  330. color: @gray;
  331. }
  332. /*
  333. disabled look for disabled choices in the results dropdown
  334. */
  335. .select2-results .select2-disabled.select2-highlighted {
  336. color: #666;
  337. background: #f4f4f4;
  338. display: list-item;
  339. cursor: default;
  340. }
  341. .select2-results .select2-disabled {
  342. background: #f4f4f4;
  343. display: list-item;
  344. cursor: default;
  345. }
  346. .select2-results .select2-selected {
  347. display: none;
  348. }
  349. // commented out temporarily until webpack/file-loader can support loading
  350. // assets from node_modules (rule is unused right now anyways)
  351. // .select2-more-results.select2-active {
  352. // background: #f4f4f4 url('~select2/select2-spinner.gif') no-repeat 100%;
  353. // }
  354. .select2-results .select2-ajax-error {
  355. background: rgba(255, 50, 50, 0.2);
  356. }
  357. .select2-more-results {
  358. background: #f4f4f4;
  359. display: list-item;
  360. }
  361. /* disabled styles */
  362. .select2-container.select2-container-disabled.form-control,
  363. .select2-container.select2-container-disabled.form-control a {
  364. background: #f9f9f9;
  365. color: #999;
  366. cursor: not-allowed;
  367. }
  368. .select2-container.select2-container-disabled .select2-choice .select2-arrow {
  369. background-color: #f4f4f4;
  370. background-image: none;
  371. border-left: 0;
  372. }
  373. .select2-container.select2-container-disabled .select2-choice abbr {
  374. display: none;
  375. }
  376. /* multiselect */
  377. .select2-container-multi .select2-choices {
  378. height: auto !important;
  379. height: 1%;
  380. margin: 0;
  381. padding: 0 5px 0 0;
  382. position: relative;
  383. border: 1px solid #aaa;
  384. cursor: text;
  385. overflow: hidden;
  386. background-color: #fff;
  387. background-image: -webkit-gradient(
  388. linear,
  389. 0% 0%,
  390. 0% 100%,
  391. color-stop(1%, #eee),
  392. color-stop(15%, #fff)
  393. );
  394. background-image: -webkit-linear-gradient(top, #eee 1%, #fff 15%);
  395. background-image: -moz-linear-gradient(top, #eee 1%, #fff 15%);
  396. background-image: linear-gradient(to bottom, #eee 1%, #fff 15%);
  397. }
  398. html[dir='rtl'] .select2-container-multi .select2-choices {
  399. padding: 0 0 0 5px;
  400. }
  401. .select2-locked {
  402. padding: 3px 5px 3px 5px !important;
  403. }
  404. .select2-container-multi .select2-choices {
  405. min-height: 26px;
  406. }
  407. .select2-container-multi.select2-container-active .select2-choices {
  408. }
  409. .select2-container-multi .select2-choices li {
  410. float: left;
  411. list-style: none;
  412. }
  413. html[dir='rtl'] .select2-container-multi .select2-choices li {
  414. float: right;
  415. }
  416. .select2-container-multi .select2-choices .select2-search-field {
  417. margin: 0;
  418. padding: 0;
  419. white-space: nowrap;
  420. }
  421. .select2-container-multi .select2-choices .select2-search-field input {
  422. padding: 5px;
  423. margin: 1px 0;
  424. font-family: sans-serif;
  425. font-size: 100%;
  426. color: #666;
  427. outline: 0;
  428. border: 0;
  429. -webkit-box-shadow: none;
  430. box-shadow: none;
  431. background: transparent !important;
  432. }
  433. // commented out temporarily until webpack/file-loader can support loading
  434. // assets from node_modules (rule is unused right now anyways)
  435. // .select2-container-multi .select2-choices .select2-search-field input.select2-active {
  436. // background: #fff url('select2-spinner.gif') no-repeat 100% !important;
  437. // }
  438. .select2-container-multi .select2-choices .select2-search-choice {
  439. padding: 3px 5px 3px 18px;
  440. margin: 3px 0 3px 5px;
  441. position: relative;
  442. line-height: 13px;
  443. color: #333;
  444. cursor: default;
  445. border: 1px solid #aaaaaa;
  446. border-radius: 3px;
  447. -webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
  448. box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
  449. background-clip: padding-box;
  450. -webkit-touch-callout: none;
  451. -webkit-user-select: none;
  452. -moz-user-select: none;
  453. -ms-user-select: none;
  454. user-select: none;
  455. background-color: #e4e4e4;
  456. }
  457. html[dir='rtl'] .select2-container-multi .select2-choices .select2-search-choice {
  458. margin: 3px 5px 3px 0;
  459. padding: 3px 18px 3px 5px;
  460. }
  461. .select2-container-multi .select2-choices .select2-search-choice .select2-chosen {
  462. cursor: default;
  463. }
  464. .select2-container-multi .select2-choices .select2-search-choice-focus {
  465. background: #d4d4d4;
  466. }
  467. .select2-search-choice-close {
  468. display: block;
  469. position: absolute;
  470. right: 3px;
  471. top: 3px;
  472. color: lighten(@gray, 30);
  473. &:hover {
  474. color: lighten(@gray, 10);
  475. }
  476. }
  477. html[dir='rtl'] .select2-search-choice-close {
  478. right: auto;
  479. left: 3px;
  480. }
  481. .select2-container-multi .select2-search-choice-close {
  482. left: 3px;
  483. }
  484. html[dir='rtl'] .select2-container-multi .select2-search-choice-close {
  485. left: auto;
  486. right: 2px;
  487. }
  488. .select2-container-multi
  489. .select2-choices
  490. .select2-search-choice
  491. .select2-search-choice-close:hover {
  492. background-position: right -11px;
  493. }
  494. .select2-container-multi
  495. .select2-choices
  496. .select2-search-choice-focus
  497. .select2-search-choice-close {
  498. background-position: right -11px;
  499. }
  500. /* disabled styles */
  501. .select2-container-multi.select2-container-disabled .select2-choices {
  502. background-color: #f4f4f4;
  503. background-image: none;
  504. border: 1px solid #ddd;
  505. cursor: default;
  506. }
  507. .select2-container-multi.select2-container-disabled
  508. .select2-choices
  509. .select2-search-choice {
  510. padding: 3px 5px 3px 5px;
  511. border: 1px solid #ddd;
  512. background-image: none;
  513. background-color: #f4f4f4;
  514. }
  515. .select2-container-multi.select2-container-disabled
  516. .select2-choices
  517. .select2-search-choice
  518. .select2-search-choice-close {
  519. display: none;
  520. background: none;
  521. }
  522. /* end multiselect */
  523. .select2-result-selectable .select2-match,
  524. .select2-result-unselectable .select2-match {
  525. text-decoration: underline;
  526. }
  527. .select2-offscreen,
  528. .select2-offscreen:focus {
  529. clip: rect(0 0 0 0) !important;
  530. // width: 1px !important;
  531. // height: 1px !important;
  532. border: 0 !important;
  533. margin: 0 !important;
  534. padding: 0 !important;
  535. overflow: hidden !important;
  536. position: absolute !important;
  537. outline: 0 !important;
  538. // left: 0px !important;
  539. // top: 0px !important;
  540. }
  541. .select2-display-none {
  542. display: none;
  543. }
  544. .select2-measure-scrollbar {
  545. position: absolute;
  546. top: -10000px;
  547. left: -10000px;
  548. width: 100px;
  549. height: 100px;
  550. overflow: scroll;
  551. }
  552. select.form-control,
  553. .select2-container.form-control {
  554. box-shadow: 0 2px 0 rgba(0, 0, 0, 0.04);
  555. background: linear-gradient(@white, @white-dark);
  556. }