_form.scss 6.2 KB

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