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.

298 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: rgba(red(@selectize-color-text), green(@selectize-color-text), blue(@selectize-color-text), 0.5);
  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. zoom: 1;
  130. *display: inline;
  131. }
  132. .selectize-control.multi & > div {
  133. cursor: pointer;
  134. margin: 0 @selectize-margin-item-x @selectize-margin-item-y 0;
  135. padding: @selectize-padding-item-y @selectize-padding-item-x;
  136. background: @selectize-color-item;
  137. color: @selectize-color-item-text;
  138. border: @selectize-width-item-border solid @selectize-color-item-border;
  139. &.active {
  140. background: @selectize-color-item-active;
  141. color: @selectize-color-item-active-text;
  142. border: @selectize-width-item-border solid @selectize-color-item-active-border;
  143. }
  144. }
  145. .selectize-control.multi &.disabled > div {
  146. &, &.active {
  147. color: lighten(desaturate(@selectize-color-item-text, 100%), @selectize-lighten-disabled-item-text);
  148. background: lighten(desaturate(@selectize-color-item, 100%), @selectize-lighten-disabled-item);
  149. border: @selectize-width-item-border solid lighten(desaturate(@selectize-color-item-border, 100%), @selectize-lighten-disabled-item-border);
  150. }
  151. }
  152. > input {
  153. &::-ms-clear {
  154. display: none;
  155. }
  156. display: inline-block !important;
  157. padding: 0 !important;
  158. min-height: 0 !important;
  159. max-height: none !important;
  160. max-width: 100% !important;
  161. margin: @selectize-caret-margin !important;
  162. text-indent: 0 !important;
  163. border: 0 none !important;
  164. background: none !important;
  165. line-height: inherit !important;
  166. -webkit-user-select: auto !important;
  167. .selectize-box-shadow(none) !important;
  168. &:focus { outline: none !important; }
  169. }
  170. }
  171. .selectize-input::after {
  172. content: ' ';
  173. display: block;
  174. clear: left;
  175. }
  176. .selectize-input.dropdown-active::before {
  177. content: ' ';
  178. display: block;
  179. position: absolute;
  180. background: @selectize-color-dropdown-border-top;
  181. height: 1px;
  182. bottom: 0;
  183. left: 0;
  184. right: 0;
  185. }
  186. .selectize-dropdown {
  187. position: absolute;
  188. z-index: 10;
  189. border: @selectize-dropdown-border;
  190. background: @selectize-color-dropdown;
  191. margin: -1px 0 0 0;
  192. border-top: 0 none;
  193. .selectize-box-sizing(border-box);
  194. .selectize-box-shadow(0 1px 3px rgba(0,0,0,0.1));
  195. .selectize-border-radius(0 0 @selectize-border-radius @selectize-border-radius);
  196. [data-selectable] {
  197. cursor: pointer;
  198. overflow: hidden;
  199. .highlight {
  200. background: @selectize-color-highlight;
  201. .selectize-border-radius(1px);
  202. }
  203. }
  204. .option, .optgroup-header {
  205. padding: @selectize-padding-dropdown-item-y @selectize-padding-dropdown-item-x;
  206. }
  207. .option, [data-disabled], [data-disabled] [data-selectable].option {
  208. cursor: inherit;
  209. opacity: 0.5;
  210. }
  211. [data-selectable].option {
  212. opacity: 1;
  213. }
  214. .optgroup:first-child .optgroup-header {
  215. border-top: 0 none;
  216. }
  217. .optgroup-header {
  218. color: @selectize-color-optgroup-text;
  219. background: @selectize-color-optgroup;
  220. cursor: default;
  221. }
  222. .active {
  223. background-color: @selectize-color-dropdown-item-active;
  224. color: @selectize-color-dropdown-item-active-text;
  225. &.create {
  226. color: @selectize-color-dropdown-item-create-active-text;
  227. }
  228. }
  229. .create {
  230. color: @selectize-color-dropdown-item-create-text;
  231. }
  232. }
  233. .selectize-dropdown-content {
  234. overflow-y: auto;
  235. overflow-x: hidden;
  236. max-height: @selectize-max-height-dropdown;
  237. -webkit-overflow-scrolling: touch;
  238. }
  239. .selectize-control.single .selectize-input {
  240. &, input { cursor: pointer; }
  241. &.input-active, &.input-active input { cursor: text; }
  242. &:after {
  243. content: ' ';
  244. display: block;
  245. position: absolute;
  246. top: 50%;
  247. right: @selectize-arrow-offset;
  248. margin-top: round((-1 * @selectize-arrow-size / 2));
  249. width: 0;
  250. height: 0;
  251. border-style: solid;
  252. border-width: @selectize-arrow-size @selectize-arrow-size 0 @selectize-arrow-size;
  253. border-color: @selectize-arrow-color transparent transparent transparent;
  254. }
  255. &.dropdown-active:after {
  256. margin-top: @selectize-arrow-size * -0.8;
  257. border-width: 0 @selectize-arrow-size @selectize-arrow-size @selectize-arrow-size;
  258. border-color: transparent transparent @selectize-arrow-color transparent;
  259. }
  260. }
  261. .selectize-control.rtl {
  262. &.single .selectize-input:after {
  263. left: @selectize-arrow-offset;
  264. right: auto;
  265. }
  266. .selectize-input > input {
  267. margin: @selectize-caret-margin-rtl !important;
  268. }
  269. }
  270. .selectize-control .selectize-input.disabled {
  271. opacity: @selectize-opacity-disabled;
  272. background-color: @selectize-color-disabled;
  273. }