_form.scss 6.5 KB

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