_form.scss 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. .form-control {
  2. border-color: $input-border-color;
  3. color: $font-color;
  4. padding: .5rem .7rem;
  5. font-size: .9rem;
  6. }
  7. .form-control-sm {
  8. padding: 0.5rem 1.5rem;
  9. }
  10. select.form-control:not([multiple=multiple]) {
  11. background-image: none;
  12. }
  13. .input-group-sm > .form-control:not(textarea), .input-group-sm > .custom-select, .form-control-sm {
  14. height: 30px;
  15. line-height: 13px;
  16. }
  17. .input-group-text {
  18. padding: 0.7rem 0.9rem;
  19. }
  20. .help-block {
  21. display: block;
  22. margin-top: 7px;
  23. margin-bottom: 10px;
  24. color: #737373;
  25. }
  26. .control-label {
  27. padding-top: 7px;
  28. padding-right: 5px;
  29. margin-bottom: 0;
  30. font-size: 1rem;
  31. text-transform: capitalize;
  32. }
  33. .fields-group .row.form-group {
  34. margin-right: 0;
  35. margin-left: 0;
  36. }
  37. @media (min-width: 768px) {
  38. .form-group .control-label {
  39. text-align: right;
  40. }
  41. }
  42. .with-errors.help-block {
  43. margin-bottom: 4px;
  44. }
  45. .has-error .checkbox,
  46. .has-error .checkbox-inline,
  47. .has-error .control-label, .has-error .help-block,
  48. .has-error .radio,
  49. .has-error .radio-inline,
  50. .has-error.checkbox label,
  51. .has-error.radio label,
  52. .has-error .form-control-position i,
  53. .has-error .form-control:focus ~ .form-control-position i {
  54. color: $red-darker;
  55. }
  56. .control-label.asterisk:before {
  57. content: "*";
  58. font-weight: bold;
  59. color: $red-darker;
  60. }
  61. .form-group.has-error .form-control {
  62. border-color: $red-darker;
  63. }
  64. .input-group-prepend .input-group-text {
  65. margin-right: -1px;
  66. }
  67. // --------------------- input-group-addon ---------------------
  68. .input-group-addon {
  69. width: 1%;
  70. white-space: nowrap;
  71. vertical-align: middle;
  72. padding: 6px 12px;
  73. font-size: 14px;
  74. font-weight: 400;
  75. line-height: 1;
  76. text-align: center;
  77. background-color: $white;
  78. border: 1px solid $input-border-color;
  79. min-width: 30px;
  80. }
  81. .input-group-sm>.input-group-addon {
  82. height: 30px;
  83. padding: 5px 10px;
  84. font-size: .7rem;
  85. line-height: 1.5;
  86. }
  87. // --------------------- input-group-addon ---------------------
  88. // --------------------- select2 ---------------------
  89. .select2-container--default .select2-selection--single,
  90. .select2-container--default .select2-selection--multiple {
  91. border-color: $input-border-color!important;
  92. }
  93. .select2-container--classic .select2-selection--multiple .select2-selection__rendered li .select2-search__field, .select2-container--default .select2-selection--multiple .select2-selection__rendered li .select2-search__field {
  94. margin-top: 8px;
  95. }
  96. .input-group {
  97. .select2-container {
  98. width: 50%!important;
  99. flex: 1 1 auto;
  100. }
  101. }
  102. .select2-container--classic .select2-selection--single, .select2-container--default .select2-selection--single {
  103. min-height: 35px;
  104. padding: 5px;
  105. border: 1px solid rgba(0,0,0,.2);
  106. }
  107. .select2-container--default .select2-selection--single .select2-selection__arrow {
  108. height: 32px!important;
  109. }
  110. .select2-dropdown {
  111. border: 1px solid rgba(0, 0, 0, 0.03)!important;
  112. box-shadow: $shadow;
  113. }
  114. .select2-container--default .select2-results__option[aria-selected=true] {
  115. background-color: $gray-bg!important;
  116. }
  117. .select2-container--default .select2-results__option--highlighted[aria-selected] {
  118. background-color: $dark40!important;
  119. color: $font-color!important;
  120. }
  121. .select2-results__option {
  122. padding: 6px 10px!important;
  123. }
  124. .select2-container--default .select2-selection--multiple .select2-selection__choice {
  125. padding: 2px 5px!important;
  126. border: 0!important;
  127. font-size: 90%;
  128. background-color: $primary!important;
  129. }
  130. .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  131. color: #fff!important;
  132. }
  133. .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  134. padding: 2px .7rem!important;
  135. }
  136. .select2-selection .default-text {
  137. display: inline-block;
  138. padding: .5rem .7rem 0;
  139. }
  140. .input-group-sm {
  141. .select2-container--classic .select2-selection--single, .select2-container--default .select2-selection--single {
  142. min-height: 31px;
  143. padding: 1px 2px;
  144. font-size: 0.7rem;
  145. }
  146. .select2-selection .default-text {
  147. padding: .3rem .5rem 0;
  148. }
  149. .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  150. padding: 0 0.4rem !important;
  151. }
  152. .select2-container--default .select2-selection--multiple {
  153. min-height: 30px !important;
  154. padding: 0 2px;
  155. font-size: 0.7rem;
  156. line-height: 14px;
  157. }
  158. .select2-container--default .select2-selection--single .select2-selection__arrow {
  159. top: -3px;
  160. }
  161. .select2-container--classic .select2-selection--multiple .select2-selection__rendered li .select2-search__field, .select2-container--default .select2-selection--multiple .select2-selection__rendered li .select2-search__field {
  162. margin-top: 6px;
  163. }
  164. }
  165. // --------------------- select2 ---------------------
  166. // listbox图标
  167. .glyphicon-arrow-right:before {
  168. font-family: feather;
  169. content: "\e829";
  170. }
  171. .glyphicon-arrow-left:before {
  172. font-family: feather;
  173. content: "\e828";
  174. }
  175. .bootstrap-duallistbox-container .info {
  176. color: $font-color!important;
  177. }
  178. //
  179. .has-icon-left .form-control-position {
  180. right: auto;
  181. left: inherit;
  182. }
  183. .form-control-position {
  184. position: absolute;
  185. top: 2px;
  186. right: 0;
  187. z-index: 2;
  188. display: block;
  189. width: 2.5rem;
  190. height: 2.5rem;
  191. line-height: 2.5rem;
  192. text-align: center;
  193. }
  194. .has-icon-left .form-control {
  195. padding-right: 2rem;
  196. padding-left: 3rem;
  197. }