_form.scss 6.6 KB

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