_form.scss 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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-search--inline {
  121. display: inline-block;
  122. }
  123. .select2-container--default .select2-dropdown .select2-search__field:focus, .select2-container--default .select2-search--inline .select2-search__field:focus {
  124. border-color: $primary!important;
  125. }
  126. .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 {
  127. margin-top: 8px;
  128. }
  129. .input-group {
  130. .select2-container {
  131. width: 50%!important;
  132. flex: 1 1 auto;
  133. }
  134. }
  135. .select2-container .select2-selection--multiple {
  136. min-height: $input-height!important;
  137. //max-height: 36px!important;
  138. }
  139. .select2-container--classic .select2-selection--single, .select2-container--default .select2-selection--single {
  140. min-height: $input-height;
  141. padding: 5px;
  142. border: 1px solid rgba(0,0,0,.2);
  143. }
  144. .select2-container--default .select2-selection--single .select2-selection__arrow {
  145. height: 32px!important;
  146. }
  147. .select2-dropdown {
  148. border: 1px solid rgba(0, 0, 0, 0.03)!important;
  149. box-shadow: $shadow;
  150. }
  151. .select2-container--default .select2-results__option[aria-selected=true] {
  152. background-color: $gray-bg!important;
  153. }
  154. .select2-container--default .select2-results__option--highlighted[aria-selected] {
  155. background-color: $dark40!important;
  156. color: $font-color!important;
  157. }
  158. .select2-results__option {
  159. padding: 6px 10px!important;
  160. }
  161. .select2-container--default .select2-selection--multiple .select2-selection__choice {
  162. padding: 2px 5px!important;
  163. border: 0!important;
  164. font-size: 90%;
  165. background-color: $primary!important;
  166. }
  167. .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  168. color: #fff!important;
  169. border-right: 0!important;
  170. }
  171. .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover, .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:focus {
  172. background-color: $primary!important;
  173. }
  174. .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  175. padding: 0 .25rem!important;
  176. }
  177. .select2-selection .default-text {
  178. display: inline-block;
  179. padding: .5rem .7rem 0;
  180. }
  181. .select2-container--default .select2-selection--single .select2-selection__rendered {
  182. line-height: 30px!important;
  183. }
  184. .input-group-sm {
  185. .select2-container--classic .select2-selection--single, .select2-container--default .select2-selection--single {
  186. min-height: 31px;
  187. padding: 1px 2px;
  188. font-size: 0.7rem;
  189. }
  190. .select2-selection .default-text {
  191. padding: .3rem .5rem 0;
  192. }
  193. .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  194. padding: 0 0.4rem !important;
  195. }
  196. .select2-container--default .select2-selection--multiple {
  197. min-height: 30px !important;
  198. padding: 0 2px;
  199. font-size: 0.7rem;
  200. line-height: 14px;
  201. }
  202. .select2-container--default .select2-selection--single .select2-selection__arrow {
  203. top: -3px;
  204. }
  205. .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 {
  206. margin-top: 6px;
  207. }
  208. }
  209. // --------------------- select2 ---------------------
  210. // listbox图标
  211. .glyphicon-arrow-right:before {
  212. font-family: feather;
  213. content: "\e829";
  214. }
  215. .glyphicon-arrow-left:before {
  216. font-family: feather;
  217. content: "\e828";
  218. }
  219. .bootstrap-duallistbox-container .info {
  220. color: $font-color!important;
  221. }
  222. //
  223. .has-icon-left .form-control-position {
  224. right: auto;
  225. left: inherit;
  226. }
  227. .form-control-position {
  228. position: absolute;
  229. top: 0;
  230. right: 0;
  231. z-index: 2;
  232. display: block;
  233. width: 2.5rem;
  234. height: 2.5rem;
  235. line-height: 2.5rem;
  236. text-align: center;
  237. }
  238. .has-icon-left .form-control {
  239. padding-right: 2rem;
  240. padding-left: 3rem;
  241. }
  242. // divider
  243. .form-divider {
  244. height: 20px;
  245. border-bottom: 1px solid #eee;
  246. span {
  247. font-size: 16px;
  248. background-color: #ffffff;
  249. padding: 0 10px;
  250. }
  251. }