_form.scss 6.4 KB

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