bootstrap-select.less 5.5 KB

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