_forms.scss 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. textarea {
  2. &[cols] {
  3. height: auto;
  4. }
  5. }
  6. /**
  7. Form label
  8. */
  9. .col-form-label,
  10. .form-label {
  11. display: block;
  12. font-weight: var(--#{$prefix}font-weight-medium);
  13. &.required {
  14. &:after {
  15. content: "*";
  16. margin-left: .25rem;
  17. color: $red;
  18. }
  19. }
  20. }
  21. .form-label-description {
  22. float: right;
  23. font-weight: var(--#{$prefix}font-weight-normal);
  24. color: $form-secondary-color;
  25. }
  26. /**
  27. Form hint
  28. */
  29. .form-hint {
  30. display: block;
  31. color: $form-secondary-color;
  32. &:last-child {
  33. margin-bottom: 0;
  34. }
  35. & + .form-control {
  36. margin-top: .25rem;
  37. }
  38. .form-label + & {
  39. margin-top: -.25rem;
  40. }
  41. .input-group + &,
  42. .form-control + &,
  43. .form-select + & {
  44. margin-top: .5rem;
  45. color: $form-secondary-color;
  46. }
  47. }
  48. /**
  49. Form select
  50. */
  51. .form-select {
  52. &:-moz-focusring {
  53. color: var(--#{$prefix}body-color);
  54. }
  55. }
  56. /**
  57. Form control
  58. */
  59. .form-control {
  60. &:-webkit-autofill {
  61. box-shadow: 0 0 0 1000px var(--#{$prefix}body-bg) inset;
  62. color: var(--#{$prefix}body-color);
  63. -webkit-text-fill-color: var(--#{$prefix}body-color);
  64. }
  65. &:disabled,
  66. &.disabled {
  67. color: $form-secondary-color;
  68. user-select: none;
  69. }
  70. &[size] {
  71. width: auto;
  72. }
  73. }
  74. .form-control-light {
  75. background-color: var(--#{$prefix}gray-100);
  76. border-color: transparent;
  77. }
  78. .form-control-dark {
  79. background-color: rgba($black, .1);
  80. color: $white;
  81. border-color: transparent;
  82. &:focus {
  83. background-color: rgba($black, .1);
  84. box-shadow: none;
  85. border-color: rgba($white, .24);
  86. }
  87. &::placeholder {
  88. color: rgba($white, .6);
  89. }
  90. }
  91. .form-control-rounded {
  92. border-radius: 10rem;
  93. }
  94. .form-control-flush {
  95. padding: 0;
  96. background: none !important;
  97. border-color: transparent !important;
  98. resize: none;
  99. box-shadow: none !important;
  100. line-height: inherit;
  101. }
  102. .form-footer {
  103. margin-top: 2rem;
  104. }
  105. .form-fieldset {
  106. padding: 1rem;
  107. margin-bottom: 1rem;
  108. background: var(--#{$prefix}body-bg);
  109. border: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}border-color);
  110. border-radius: var(--#{$prefix}border-radius);
  111. }
  112. fieldset:empty {
  113. display: none;
  114. }
  115. /**
  116. Form help
  117. */
  118. .form-help {
  119. display: inline-flex;
  120. font-weight: var(--#{$prefix}font-weight-bold);
  121. align-items: center;
  122. justify-content: center;
  123. width: 1.125rem;
  124. height: 1.125rem;
  125. font-size: .75rem;
  126. color: $form-secondary-color;
  127. text-align: center;
  128. text-decoration: none;
  129. cursor: pointer;
  130. user-select: none;
  131. background: var(--#{$prefix}gray-100);
  132. border-radius: $border-radius-pill;
  133. @include transition(background-color $transition-time, color $transition-time);
  134. &:hover,
  135. &[aria-describedby] {
  136. color: $white;
  137. background: var(--#{$prefix}primary);
  138. }
  139. }
  140. /**
  141. Input group
  142. */
  143. .input-group {
  144. box-shadow: $input-box-shadow;
  145. border-radius: $input-border-radius;
  146. .form-control,
  147. .btn {
  148. box-shadow: none;
  149. }
  150. }
  151. .input-group-link {
  152. font-size: $h5-font-size;
  153. }
  154. .input-group-flat {
  155. &:focus-within {
  156. box-shadow: $input-focus-box-shadow;
  157. border-radius: $input-border-radius;
  158. .form-control,
  159. .input-group-text {
  160. border-color: $input-focus-border-color !important;
  161. }
  162. }
  163. .form-control {
  164. &:focus {
  165. border-color: $input-border-color;
  166. box-shadow: none;
  167. }
  168. &:not(:last-child) {
  169. border-right: 0;
  170. }
  171. &:not(:first-child) {
  172. border-left: 0;
  173. }
  174. }
  175. .input-group-text {
  176. background: $form-check-input-bg;
  177. @include transition($input-transition);
  178. &:first-child {
  179. padding-right: 0;
  180. }
  181. &:last-child {
  182. padding-left: 0;
  183. }
  184. }
  185. }
  186. /**
  187. Upload files
  188. */
  189. .form-file-button {
  190. margin-left: 0;
  191. border-left: 0;
  192. }