bootstrap-select.less 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. @import "variables";
  2. // Mixins
  3. .cursor-disabled() {
  4. cursor: not-allowed;
  5. }
  6. // Rules
  7. select.bs-select-hidden,
  8. select.selectpicker {
  9. display: none !important;
  10. }
  11. .bootstrap-select {
  12. width: 220px \0; /*IE9 and below*/
  13. // The selectpicker button
  14. > .dropdown-toggle {
  15. width: 100%;
  16. padding-right: 25px;
  17. z-index: 1;
  18. &.bs-placeholder,
  19. &.bs-placeholder:hover,
  20. &.bs-placeholder:focus,
  21. &.bs-placeholder:active { color: @input-color-placeholder; }
  22. }
  23. > select {
  24. position: absolute !important;
  25. bottom: 0;
  26. left: 50%;
  27. display: block !important;
  28. width: 0.5px !important;
  29. height: 100% !important;
  30. padding: 0 !important;
  31. opacity: 0 !important;
  32. border: none;
  33. &.mobile-device {
  34. top: 0;
  35. left: 0;
  36. display: block !important;
  37. width: 100% !important;
  38. z-index: 2;
  39. }
  40. }
  41. // Error display
  42. .has-error & .dropdown-toggle,
  43. .error & .dropdown-toggle {
  44. border-color: @color-red-error;
  45. }
  46. &.fit-width {
  47. width: auto !important;
  48. }
  49. &:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) {
  50. width: @width-default;
  51. }
  52. .dropdown-toggle:focus {
  53. outline: thin dotted #333333 !important;
  54. outline: 5px auto -webkit-focus-ring-color !important;
  55. outline-offset: -2px;
  56. }
  57. }
  58. .bootstrap-select.form-control {
  59. margin-bottom: 0;
  60. padding: 0;
  61. border: none;
  62. &:not([class*="col-"]) {
  63. width: 100%;
  64. }
  65. &.input-group-btn {
  66. z-index: auto;
  67. &:not(:first-child):not(:last-child) {
  68. > .btn {
  69. border-radius: 0;
  70. }
  71. }
  72. }
  73. }
  74. // The selectpicker components
  75. .bootstrap-select.btn-group {
  76. &:not(.input-group-btn),
  77. &[class*="col-"] {
  78. float: none;
  79. display: inline-block;
  80. margin-left: 0;
  81. }
  82. // Forces the pull to the right, if necessary
  83. &,
  84. &[class*="col-"],
  85. .row &[class*="col-"] {
  86. &.dropdown-menu-right {
  87. float: right;
  88. }
  89. }
  90. .form-inline &,
  91. .form-horizontal &,
  92. .form-group & {
  93. margin-bottom: 0;
  94. }
  95. .form-group-lg &.form-control,
  96. .form-group-sm &.form-control {
  97. padding: 0;
  98. }
  99. // Set the width of the live search (and any other form control within an inline form)
  100. // see https://github.com/silviomoreto/bootstrap-select/issues/685
  101. .form-inline & .form-control {
  102. width: 100%;
  103. }
  104. &.disabled,
  105. > .disabled {
  106. .cursor-disabled();
  107. &:focus {
  108. outline: none !important;
  109. }
  110. }
  111. &.bs-container {
  112. position: absolute;
  113. height: 0 !important;
  114. padding: 0 !important;
  115. .dropdown-menu {
  116. z-index: @zindex-select-dropdown;
  117. }
  118. }
  119. // The selectpicker button
  120. .dropdown-toggle {
  121. .filter-option {
  122. display: inline-block;
  123. overflow: hidden;
  124. width: 100%;
  125. text-align: left;
  126. }
  127. .caret {
  128. position: absolute;
  129. top: 50%;
  130. right: 12px;
  131. margin-top: -2px;
  132. vertical-align: middle;
  133. }
  134. }
  135. &[class*="col-"] .dropdown-toggle {
  136. width: 100%;
  137. }
  138. // The selectpicker dropdown
  139. .dropdown-menu {
  140. min-width: 100%;
  141. box-sizing: border-box;
  142. &.inner {
  143. position: static;
  144. float: none;
  145. border: 0;
  146. padding: 0;
  147. margin: 0;
  148. border-radius: 0;
  149. box-shadow: none;
  150. }
  151. li {
  152. position: relative;
  153. &.active small {
  154. color: #fff;
  155. }
  156. &.disabled a {
  157. .cursor-disabled();
  158. }
  159. a {
  160. cursor: pointer;
  161. -webkit-user-select: none;
  162. -moz-user-select: none;
  163. -ms-user-select: none;
  164. user-select: none;
  165. &.opt {
  166. position: relative;
  167. padding-left: 2.25em;
  168. }
  169. span.check-mark {
  170. display: none;
  171. }
  172. span.text {
  173. display: inline-block;
  174. }
  175. }
  176. small {
  177. padding-left: 0.5em;
  178. }
  179. }
  180. .notify {
  181. position: absolute;
  182. bottom: 5px;
  183. width: 96%;
  184. margin: 0 2%;
  185. min-height: 26px;
  186. padding: 3px 5px;
  187. background: rgb(245, 245, 245);
  188. border: 1px solid rgb(227, 227, 227);
  189. box-shadow: inset 0 1px 1px fade(rgb(0, 0, 0), 5%);
  190. pointer-events: none;
  191. opacity: 0.9;
  192. box-sizing: border-box;
  193. }
  194. }
  195. .no-results {
  196. padding: 3px;
  197. background: #f5f5f5;
  198. margin: 0 5px;
  199. white-space: nowrap;
  200. }
  201. &.fit-width .dropdown-toggle {
  202. .filter-option {
  203. position: static;
  204. }
  205. .caret {
  206. position: static;
  207. top: auto;
  208. margin-top: -1px;
  209. }
  210. }
  211. &.show-tick .dropdown-menu li {
  212. &.selected a span.check-mark {
  213. position: absolute;
  214. display: inline-block;
  215. right: 15px;
  216. margin-top: 5px;
  217. }
  218. a span.text {
  219. margin-right: 34px;
  220. }
  221. }
  222. }
  223. .bootstrap-select.show-menu-arrow {
  224. &.open > .dropdown-toggle {
  225. z-index: (@zindex-select-dropdown + 1);
  226. }
  227. .dropdown-toggle {
  228. &:before {
  229. content: '';
  230. border-left: 7px solid transparent;
  231. border-right: 7px solid transparent;
  232. border-bottom: 7px solid @color-grey-arrow;
  233. position: absolute;
  234. bottom: -4px;
  235. left: 9px;
  236. display: none;
  237. }
  238. &:after {
  239. content: '';
  240. border-left: 6px solid transparent;
  241. border-right: 6px solid transparent;
  242. border-bottom: 6px solid white;
  243. position: absolute;
  244. bottom: -4px;
  245. left: 10px;
  246. display: none;
  247. }
  248. }
  249. &.dropup .dropdown-toggle {
  250. &:before {
  251. bottom: auto;
  252. top: -3px;
  253. border-top: 7px solid @color-grey-arrow;
  254. border-bottom: 0;
  255. }
  256. &:after {
  257. bottom: auto;
  258. top: -3px;
  259. border-top: 6px solid white;
  260. border-bottom: 0;
  261. }
  262. }
  263. &.pull-right .dropdown-toggle {
  264. &:before {
  265. right: 12px;
  266. left: auto;
  267. }
  268. &:after {
  269. right: 13px;
  270. left: auto;
  271. }
  272. }
  273. &.open > .dropdown-toggle {
  274. &:before,
  275. &:after {
  276. display: block;
  277. }
  278. }
  279. }
  280. .bs-searchbox,
  281. .bs-actionsbox,
  282. .bs-donebutton {
  283. padding: 4px 8px;
  284. }
  285. .bs-actionsbox {
  286. width: 100%;
  287. box-sizing: border-box;
  288. & .btn-group button {
  289. width: 50%;
  290. }
  291. }
  292. .bs-donebutton {
  293. float: left;
  294. width: 100%;
  295. box-sizing: border-box;
  296. & .btn-group button {
  297. width: 100%;
  298. }
  299. }
  300. .bs-searchbox {
  301. & + .bs-actionsbox {
  302. padding: 0 8px 4px;
  303. }
  304. & .form-control {
  305. margin-bottom: 0;
  306. width: 100%;
  307. float: none;
  308. }
  309. }