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.

152 lines
4.8 KiB

  1. /**
  2. * selectize.bootstrap3.css (v@@version) - Bootstrap 3 Theme
  3. * Copyright (c) 2013–2015 Brian Reavis & contributors
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
  6. * file except in compliance with the License. You may obtain a copy of the License at:
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software distributed under
  10. * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
  11. * ANY KIND, either express or implied. See the License for the specific language
  12. * governing permissions and limitations under the License.
  13. *
  14. * @author Brian Reavis <[email protected]>
  15. */
  16. @import "../bootstrap/variables.less";
  17. @import "../bootstrap/mixins.less";
  18. @import "selectize";
  19. @selectize-font-family: inherit;
  20. @selectize-font-size: inherit;
  21. @selectize-line-height: @line-height-computed;
  22. @selectize-color-text: @text-color;
  23. @selectize-color-highlight: rgba(255,237,40,0.4);
  24. @selectize-color-input: @input-bg;
  25. @selectize-color-input-full: @input-bg;
  26. @selectize-color-input-error: @state-danger-text;
  27. @selectize-color-input-error-focus: darken(@selectize-color-input-error, 10%);
  28. @selectize-color-disabled: @input-bg;
  29. @selectize-color-item: #efefef;
  30. @selectize-color-item-border: rgba(0,0,0,0);
  31. @selectize-color-item-active: @component-active-bg;
  32. @selectize-color-item-active-text: #fff;
  33. @selectize-color-item-active-border: rgba(0,0,0,0);
  34. @selectize-color-optgroup: @dropdown-bg;
  35. @selectize-color-optgroup-text: @dropdown-header-color;
  36. @selectize-color-optgroup-border: @dropdown-divider-bg;
  37. @selectize-color-dropdown: @dropdown-bg;
  38. @selectize-color-dropdown-border-top: mix(@input-border, @input-bg, 0.8);
  39. @selectize-color-dropdown-item-active: @dropdown-link-hover-bg;
  40. @selectize-color-dropdown-item-active-text: @dropdown-link-hover-color;
  41. @selectize-color-dropdown-item-create-active-text: @dropdown-link-hover-color;
  42. @selectize-opacity-disabled: 0.5;
  43. @selectize-shadow-input: none;
  44. @selectize-shadow-input-focus: inset 0 1px 2px rgba(0,0,0,0.15);
  45. @selectize-shadow-input-error: inset 0 1px 1px rgba(0, 0, 0, .075);
  46. @selectize-shadow-input-error-focus: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px lighten(@selectize-color-input-error, 20%);
  47. @selectize-border: 1px solid @input-border;
  48. @selectize-border-radius: @input-border-radius;
  49. @selectize-width-item-border: 0;
  50. @selectize-padding-x: @padding-base-horizontal;
  51. @selectize-padding-y: @padding-base-vertical;
  52. @selectize-padding-dropdown-item-x: @padding-base-horizontal;
  53. @selectize-padding-dropdown-item-y: 3px;
  54. @selectize-padding-item-x: 6px;
  55. @selectize-padding-item-y: 2px;
  56. @selectize-margin-item-x: 3px;
  57. @selectize-margin-item-y: 3px;
  58. @selectize-caret-margin: 0;
  59. @selectize-arrow-size: 5px;
  60. @selectize-arrow-color: @selectize-color-text;
  61. @selectize-arrow-offset: @selectize-padding-x + 5px;
  62. .selectize-dropdown, .selectize-dropdown.form-control {
  63. height: auto;
  64. padding: 0;
  65. margin: 2px 0 0 0;
  66. z-index: @zindex-dropdown;
  67. background: @selectize-color-dropdown;
  68. border: 1px solid @dropdown-fallback-border;
  69. border: 1px solid @dropdown-border;
  70. .selectize-border-radius(@border-radius-base);
  71. .selectize-box-shadow(0 6px 12px rgba(0,0,0,.175));
  72. }
  73. .selectize-dropdown {
  74. .optgroup-header {
  75. font-size: @font-size-small;
  76. line-height: @line-height-base;
  77. }
  78. .optgroup:first-child:before {
  79. display: none;
  80. }
  81. .optgroup:before {
  82. content: ' ';
  83. display: block;
  84. .nav-divider();
  85. margin-left: @selectize-padding-dropdown-item-x * -1;
  86. margin-right: @selectize-padding-dropdown-item-x * -1;
  87. }
  88. }
  89. .selectize-dropdown-content {
  90. padding: 5px 0;
  91. }
  92. .selectize-dropdown-header {
  93. padding: @selectize-padding-dropdown-item-y * 2 @selectize-padding-dropdown-item-x;
  94. }
  95. .selectize-input {
  96. min-height: @input-height-base;
  97. &.dropdown-active {
  98. .selectize-border-radius(@selectize-border-radius);
  99. }
  100. &.dropdown-active::before {
  101. display: none;
  102. }
  103. &.focus {
  104. @color: @input-border-focus;
  105. @color-rgba: rgba(red(@color), green(@color), blue(@color), .2);
  106. border-color: @color;
  107. outline: 0;
  108. .selectize-box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 0 4px @{color-rgba}");
  109. }
  110. }
  111. .has-error .selectize-input {
  112. border-color: @selectize-color-input-error;
  113. .selectize-box-shadow(@selectize-shadow-input-error);
  114. &:focus {
  115. border-color: @selectize-color-input-error-focus;
  116. .selectize-box-shadow(@selectize-shadow-input-error-focus);
  117. }
  118. }
  119. .selectize-control {
  120. &.multi {
  121. .selectize-input.has-items {
  122. padding-left: @selectize-padding-x - @selectize-padding-item-x;
  123. padding-right: @selectize-padding-x - @selectize-padding-item-x;
  124. }
  125. .selectize-input > div {
  126. .selectize-border-radius(@selectize-border-radius - 1px);
  127. }
  128. }
  129. }
  130. .form-control.selectize-control {
  131. padding: 0;
  132. height: auto;
  133. border: none;
  134. background: none;
  135. .selectize-box-shadow(none);
  136. .selectize-border-radius(0);
  137. }