You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

296 lines
8.9 KiB

  1. // base styles
  2. @selectize-font-family: inherit;
  3. @selectize-font-smoothing: inherit;
  4. @selectize-font-size: 13px;
  5. @selectize-line-height: 18px;
  6. @selectize-color-text: #303030;
  7. @selectize-color-border: #d0d0d0;
  8. @selectize-color-highlight: rgba(125,168,208,0.2);
  9. @selectize-color-input: #fff;
  10. @selectize-color-input-full: @selectize-color-input;
  11. @selectize-color-disabled: #fafafa;
  12. @selectize-color-item: #f2f2f2;
  13. @selectize-color-item-text: @selectize-color-text;
  14. @selectize-color-item-border: #d0d0d0;
  15. @selectize-color-item-active: #e8e8e8;
  16. @selectize-color-item-active-text: @selectize-color-text;
  17. @selectize-color-item-active-border: #cacaca;
  18. @selectize-color-dropdown: #fff;
  19. @selectize-color-dropdown-border: @selectize-color-border;
  20. @selectize-color-dropdown-border-top: #f0f0f0;
  21. @selectize-color-dropdown-item-active: #f5fafd;
  22. @selectize-color-dropdown-item-active-text: #495c68;
  23. @selectize-color-dropdown-item-create-text: @selectize-color-text;
  24. @selectize-color-dropdown-item-create-active-text: @selectize-color-dropdown-item-active-text;
  25. @selectize-color-optgroup: @selectize-color-dropdown;
  26. @selectize-color-optgroup-text: @selectize-color-text;
  27. @selectize-lighten-disabled-item: 30%;
  28. @selectize-lighten-disabled-item-text: 30%;
  29. @selectize-lighten-disabled-item-border: 30%;
  30. @selectize-opacity-disabled: 0.5;
  31. @selectize-shadow-input: inset 0 1px 1px rgba(0,0,0,0.1);
  32. @selectize-shadow-input-focus: inset 0 1px 2px rgba(0,0,0,0.15);
  33. @selectize-border: 1px solid @selectize-color-border;
  34. @selectize-dropdown-border: 1px solid @selectize-color-dropdown-border;
  35. @selectize-border-radius: 3px;
  36. @selectize-width-item-border: 0;
  37. @selectize-max-height-dropdown: 200px;
  38. @selectize-padding-x: 8px;
  39. @selectize-padding-y: 8px;
  40. @selectize-padding-item-x: 6px;
  41. @selectize-padding-item-y: 2px;
  42. @selectize-padding-dropdown-item-x: @selectize-padding-x;
  43. @selectize-padding-dropdown-item-y: 5px;
  44. @selectize-margin-item-x: 3px;
  45. @selectize-margin-item-y: 3px;
  46. @selectize-arrow-size: 5px;
  47. @selectize-arrow-color: #808080;
  48. @selectize-arrow-offset: 15px;
  49. @selectize-caret-margin: 0 2px 0 0;
  50. @selectize-caret-margin-rtl: 0 4px 0 -2px;
  51. .selectize-border-radius (@radii) {
  52. -webkit-border-radius: @radii;
  53. border-radius: @radii;
  54. }
  55. .selectize-unselectable () {
  56. -webkit-user-select: none;
  57. -moz-user-select: none;
  58. -ms-user-select: none;
  59. user-select: none;
  60. }
  61. .selectize-box-shadow (@shadow) {
  62. -webkit-box-shadow: @shadow;
  63. box-shadow: @shadow;
  64. }
  65. .selectize-box-sizing (@type: border-box) {
  66. -webkit-box-sizing: @type;
  67. -moz-box-sizing: @type;
  68. box-sizing: @type;
  69. }
  70. .selectize-vertical-gradient (@color-top, @color-bottom) {
  71. background-color: mix(@color-top, @color-bottom, 60%);
  72. background-image: -moz-linear-gradient(top, @color-top, @color-bottom); // FF 3.6+
  73. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@color-top), to(@color-bottom)); // Safari 4+, Chrome 2+
  74. background-image: -webkit-linear-gradient(top, @color-top, @color-bottom); // Safari 5.1+, Chrome 10+
  75. background-image: -o-linear-gradient(top, @color-top, @color-bottom); // Opera 11.10
  76. background-image: linear-gradient(to bottom, @color-top, @color-bottom); // Standard, IE10
  77. background-repeat: repeat-x;
  78. filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@color-top),argb(@color-bottom))); // IE9 and down
  79. }
  80. .selectize-control {
  81. position: relative;
  82. }
  83. .selectize-dropdown, .selectize-input, .selectize-input input {
  84. color: @selectize-color-text;
  85. font-family: @selectize-font-family;
  86. font-size: @selectize-font-size;
  87. line-height: @selectize-line-height;
  88. -webkit-font-smoothing: @selectize-font-smoothing;
  89. }
  90. .selectize-input, .selectize-control.single .selectize-input.input-active {
  91. background: @selectize-color-input;
  92. cursor: text;
  93. display: inline-block;
  94. }
  95. .selectize-input {
  96. border: @selectize-border;
  97. padding: @selectize-padding-y @selectize-padding-x;
  98. display: inline-block;
  99. width: 100%;
  100. overflow: hidden;
  101. position: relative;
  102. z-index: 1;
  103. .selectize-box-sizing(border-box);
  104. .selectize-box-shadow(@selectize-shadow-input);
  105. .selectize-border-radius(@selectize-border-radius);
  106. .selectize-control.multi &.has-items {
  107. @padding-x: @selectize-padding-x;
  108. @padding-top: @selectize-padding-y - @selectize-padding-item-y - @selectize-width-item-border;
  109. @padding-bottom: @selectize-padding-y - @selectize-padding-item-y - @selectize-margin-item-y - @selectize-width-item-border;
  110. padding: @padding-top @padding-x @padding-bottom;
  111. }
  112. &.full {
  113. background-color: @selectize-color-input-full;
  114. }
  115. &.disabled, &.disabled * {
  116. cursor: default !important;
  117. }
  118. &.focus {
  119. .selectize-box-shadow(@selectize-shadow-input-focus);
  120. }
  121. &.dropdown-active {
  122. .selectize-border-radius(@selectize-border-radius @selectize-border-radius 0 0);
  123. }
  124. > * {
  125. vertical-align: baseline;
  126. display: -moz-inline-stack;
  127. display: inline-block;
  128. *display: inline;
  129. }
  130. .selectize-control.multi & > div {
  131. cursor: pointer;
  132. margin: 0 @selectize-margin-item-x @selectize-margin-item-y 0;
  133. padding: @selectize-padding-item-y @selectize-padding-item-x;
  134. background: @selectize-color-item;
  135. color: @selectize-color-item-text;
  136. border: @selectize-width-item-border solid @selectize-color-item-border;
  137. &.active {
  138. background: @selectize-color-item-active;
  139. color: @selectize-color-item-active-text;
  140. border: @selectize-width-item-border solid @selectize-color-item-active-border;
  141. }
  142. }
  143. // .selectize-control.multi &.disabled > div {
  144. // &, &.active {
  145. // color: lighten(desaturate(@selectize-color-item-text, 100%), @selectize-lighten-disabled-item-text);
  146. // background: lighten(desaturate(@selectize-color-item, 100%), @selectize-lighten-disabled-item);
  147. // border: @selectize-width-item-border solid lighten(desaturate(@selectize-color-item-border, 100%), @selectize-lighten-disabled-item-border);
  148. // }
  149. // }
  150. > input {
  151. &::-ms-clear {
  152. display: none;
  153. }
  154. display: inline-block !important;
  155. padding: 0 !important;
  156. min-height: 0 !important;
  157. max-height: none !important;
  158. max-width: 100% !important;
  159. margin: @selectize-caret-margin !important;
  160. text-indent: 0 !important;
  161. border: 0 none !important;
  162. background: none !important;
  163. line-height: inherit !important;
  164. -webkit-user-select: auto !important;
  165. .selectize-box-shadow(none) !important;
  166. &:focus { outline: none !important; }
  167. }
  168. }
  169. .selectize-input::after {
  170. content: ' ';
  171. display: block;
  172. clear: left;
  173. }
  174. .selectize-input.dropdown-active::before {
  175. content: ' ';
  176. display: block;
  177. position: absolute;
  178. background: @selectize-color-dropdown-border-top;
  179. height: 1px;
  180. bottom: 0;
  181. left: 0;
  182. right: 0;
  183. }
  184. .selectize-dropdown {
  185. position: absolute;
  186. z-index: 10;
  187. border: @selectize-dropdown-border;
  188. background: @selectize-color-dropdown;
  189. margin: -1px 0 0 0;
  190. border-top: 0 none;
  191. .selectize-box-sizing(border-box);
  192. .selectize-box-shadow(0 1px 3px rgba(0,0,0,0.1));
  193. .selectize-border-radius(0 0 @selectize-border-radius @selectize-border-radius);
  194. [data-selectable] {
  195. cursor: pointer;
  196. overflow: hidden;
  197. .highlight {
  198. background: @selectize-color-highlight;
  199. .selectize-border-radius(1px);
  200. }
  201. }
  202. .option, .optgroup-header {
  203. padding: @selectize-padding-dropdown-item-y @selectize-padding-dropdown-item-x;
  204. }
  205. .option, [data-disabled], [data-disabled] [data-selectable].option {
  206. cursor: inherit;
  207. opacity: 0.5;
  208. }
  209. [data-selectable].option {
  210. opacity: 1;
  211. }
  212. .optgroup:first-child .optgroup-header {
  213. border-top: 0 none;
  214. }
  215. .optgroup-header {
  216. color: @selectize-color-optgroup-text;
  217. background: @selectize-color-optgroup;
  218. cursor: default;
  219. }
  220. .active {
  221. background-color: @selectize-color-dropdown-item-active;
  222. color: @selectize-color-dropdown-item-active-text;
  223. &.create {
  224. color: @selectize-color-dropdown-item-create-active-text;
  225. }
  226. }
  227. .create {
  228. color: @selectize-color-dropdown-item-create-text;
  229. }
  230. }
  231. .selectize-dropdown-content {
  232. overflow-y: auto;
  233. overflow-x: hidden;
  234. max-height: @selectize-max-height-dropdown;
  235. -webkit-overflow-scrolling: touch;
  236. }
  237. .selectize-control.single .selectize-input {
  238. &, input { cursor: pointer; }
  239. &.input-active, &.input-active input { cursor: text; }
  240. &:after {
  241. content: ' ';
  242. display: block;
  243. position: absolute;
  244. top: 50%;
  245. right: @selectize-arrow-offset;
  246. margin-top: round((-1 * @selectize-arrow-size / 2));
  247. width: 0;
  248. height: 0;
  249. border-style: solid;
  250. border-width: @selectize-arrow-size @selectize-arrow-size 0 @selectize-arrow-size;
  251. border-color: @selectize-arrow-color transparent transparent transparent;
  252. }
  253. &.dropdown-active:after {
  254. margin-top: @selectize-arrow-size * -0.8;
  255. border-width: 0 @selectize-arrow-size @selectize-arrow-size @selectize-arrow-size;
  256. border-color: transparent transparent @selectize-arrow-color transparent;
  257. }
  258. }
  259. .selectize-control.rtl {
  260. &.single .selectize-input:after {
  261. left: @selectize-arrow-offset;
  262. right: auto;
  263. }
  264. .selectize-input > input {
  265. margin: @selectize-caret-margin-rtl !important;
  266. }
  267. }
  268. .selectize-control .selectize-input.disabled {
  269. opacity: @selectize-opacity-disabled;
  270. background-color: @selectize-color-disabled;
  271. }