_form.scss 7.0 KB

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