_form.scss 6.4 KB

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