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.

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