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.

153 lines
4.9 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-dropdown-item-create-text: @text-color;
  30. @selectize-color-item: var(--selectize-tag-bg);
  31. @selectize-color-item-border: rgba(0,0,0,0);
  32. @selectize-color-item-active: @component-active-bg;
  33. @selectize-color-item-active-text: #fff;
  34. @selectize-color-item-active-border: rgba(0,0,0,0);
  35. @selectize-color-optgroup: @dropdown-bg;
  36. @selectize-color-optgroup-text: @dropdown-header-color;
  37. @selectize-color-optgroup-border: @dropdown-divider-bg;
  38. @selectize-color-dropdown: @dropdown-bg;
  39. @selectize-color-dropdown-border-top: @input-border;
  40. @selectize-color-dropdown-item-active: @dropdown-link-hover-bg;
  41. @selectize-color-dropdown-item-active-text: @dropdown-link-hover-color;
  42. @selectize-color-dropdown-item-create-active-text: @dropdown-link-hover-color;
  43. @selectize-opacity-disabled: 0.5;
  44. @selectize-shadow-input: none;
  45. @selectize-shadow-input-focus: inset 0 1px 2px rgba(0,0,0,0.15);
  46. @selectize-shadow-input-error: inset 0 1px 1px rgba(0, 0, 0, .075);
  47. @selectize-shadow-input-error-focus: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px lighten(@selectize-color-input-error, 20%);
  48. @selectize-border: 1px solid @input-border;
  49. @selectize-border-radius: @input-border-radius;
  50. @selectize-width-item-border: 0;
  51. @selectize-padding-x: @padding-base-horizontal;
  52. @selectize-padding-y: @padding-base-vertical;
  53. @selectize-padding-dropdown-item-x: @padding-base-horizontal;
  54. @selectize-padding-dropdown-item-y: 3px;
  55. @selectize-padding-item-x: 6px;
  56. @selectize-padding-item-y: 2px;
  57. @selectize-margin-item-x: 3px;
  58. @selectize-margin-item-y: 3px;
  59. @selectize-caret-margin: 0;
  60. @selectize-arrow-size: 5px;
  61. @selectize-arrow-color: @selectize-color-text;
  62. @selectize-arrow-offset: @selectize-padding-x + 5px;
  63. .selectize-dropdown, .selectize-dropdown.form-control {
  64. height: auto;
  65. padding: 0;
  66. margin: 2px 0 0 0;
  67. z-index: @zindex-dropdown;
  68. background: @selectize-color-dropdown;
  69. border: 1px solid @dropdown-fallback-border;
  70. border: 1px solid @dropdown-border;
  71. .selectize-border-radius(@border-radius-base);
  72. .selectize-box-shadow(0 6px 12px rgba(0,0,0,.175));
  73. }
  74. .selectize-dropdown {
  75. .optgroup-header {
  76. font-size: @font-size-small;
  77. line-height: @line-height-base;
  78. }
  79. .optgroup:first-child:before {
  80. display: none;
  81. }
  82. .optgroup:before {
  83. content: ' ';
  84. display: block;
  85. .nav-divider();
  86. margin-left: @selectize-padding-dropdown-item-x * -1;
  87. margin-right: @selectize-padding-dropdown-item-x * -1;
  88. }
  89. }
  90. .selectize-dropdown-content {
  91. padding: 5px 0;
  92. }
  93. .selectize-dropdown-header {
  94. padding: @selectize-padding-dropdown-item-y * 2 @selectize-padding-dropdown-item-x;
  95. }
  96. .selectize-input {
  97. min-height: @input-height-base;
  98. &.dropdown-active {
  99. .selectize-border-radius(@selectize-border-radius);
  100. }
  101. &.dropdown-active::before {
  102. display: none;
  103. }
  104. &.focus {
  105. @color: @input-border-focus;
  106. @color-rgba: rgba(red(@color), green(@color), blue(@color), .2);
  107. border-color: @color;
  108. outline: 0;
  109. .selectize-box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 0 4px @{color-rgba}");
  110. }
  111. }
  112. .has-error .selectize-input {
  113. border-color: @selectize-color-input-error;
  114. .selectize-box-shadow(@selectize-shadow-input-error);
  115. &:focus {
  116. border-color: @selectize-color-input-error-focus;
  117. .selectize-box-shadow(@selectize-shadow-input-error-focus);
  118. }
  119. }
  120. .selectize-control {
  121. &.multi {
  122. .selectize-input.has-items {
  123. padding-left: @selectize-padding-x - @selectize-padding-item-x;
  124. padding-right: @selectize-padding-x - @selectize-padding-item-x;
  125. }
  126. .selectize-input > div {
  127. .selectize-border-radius(@selectize-border-radius - 1px);
  128. }
  129. }
  130. }
  131. .form-control.selectize-control {
  132. padding: 0;
  133. height: auto;
  134. border: none;
  135. background: none;
  136. .selectize-box-shadow(none);
  137. .selectize-border-radius(0);
  138. }