_gf-form.scss 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. $gf-form-margin: 0.25rem;
  2. .gf-form {
  3. margin-bottom: $gf-form-margin;
  4. display: flex;
  5. flex-direction: row;
  6. align-items: center;
  7. text-align: left;
  8. position: relative;
  9. .cr1 {
  10. margin-left: 8px;
  11. }
  12. }
  13. .gf-form-group {
  14. margin-bottom: $spacer * 2.5;
  15. }
  16. .gf-form-inline {
  17. display: flex;
  18. flex-direction: row;
  19. flex-wrap: wrap;
  20. align-content: flex-start;
  21. .gf-form-flex {
  22. flex-grow: 1;
  23. }
  24. }
  25. .gf-form-button-row {
  26. padding-top: $spacer * 1.5;
  27. a, button {
  28. margin-right: $spacer;
  29. }
  30. }
  31. .gf-form-label {
  32. padding: $input-padding-y $input-padding-x;
  33. margin-right: $gf-form-margin;
  34. line-height: $input-line-height;
  35. flex-shrink: 0;
  36. background-color: $input-label-bg;
  37. display: block;
  38. font-size: $font-size-sm;
  39. margin-right: $gf-form-margin;
  40. border: $input-btn-border-width solid transparent;
  41. @include border-radius($label-border-radius-sm);
  42. }
  43. .gf-form-checkbox {
  44. flex-shrink: 0;
  45. padding: $input-padding-y $input-padding-x;
  46. line-height: $input-line-height;
  47. .checkbox-label {
  48. display: inline;
  49. cursor: pointer;
  50. padding: $input-padding-y 0.4rem;
  51. line-height: $input-line-height;
  52. }
  53. }
  54. .gf-form-input {
  55. display: block;
  56. width: 100%;
  57. padding: $input-padding-y $input-padding-x;
  58. margin-right: $gf-form-margin;
  59. font-size: $font-size-base;
  60. line-height: $input-line-height;
  61. color: $input-color;
  62. background-color: $input-bg;
  63. background-image: none;
  64. background-clip: padding-box;
  65. border: $input-btn-border-width solid $input-border-color;
  66. @include border-radius($input-border-radius-sm);
  67. @include box-shadow($input-box-shadow);
  68. transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
  69. // Unstyle the caret on `<select>`s in IE10+.
  70. &::-ms-expand {
  71. background-color: transparent;
  72. border: 0;
  73. display: none;
  74. }
  75. // Customize the `:focus` state to imitate native WebKit styles.
  76. @include form-control-focus();
  77. // Placeholder
  78. &::placeholder {
  79. color: $input-color-placeholder;
  80. opacity: 1;
  81. }
  82. &:disabled,
  83. &[readonly] {
  84. background-color: $input-bg-disabled;
  85. // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
  86. opacity: 1;
  87. }
  88. &:disabled {
  89. cursor: $cursor-disabled;
  90. }
  91. &.gf-size-auto { width: auto; }
  92. }
  93. .gf-form-select-wrapper {
  94. margin-right: $gf-form-margin;
  95. position: relative;
  96. background-color: $input-bg;
  97. select.gf-form-input {
  98. text-indent: .01px;
  99. text-overflow: '';
  100. padding-right: $input-padding-x*2;
  101. -webkit-appearance: none;
  102. -moz-appearance: menulist-text; // was set to "window" and caused odd display on windos and linux.
  103. appearance: none;
  104. &:-moz-focusring {
  105. outline: none;
  106. color: transparent;
  107. text-shadow: 0 0 0 $text-color;
  108. }
  109. }
  110. &:after {
  111. position: absolute;
  112. top: 35%;
  113. right: $input-padding-x/2;
  114. background-color: transparent;
  115. color: $input-color;
  116. font: normal normal normal $font-size-sm/1 FontAwesome;
  117. content: '\f0d7';
  118. pointer-events: none;
  119. }
  120. &--has-help-icon {
  121. &:after {
  122. right: $input-padding-x*3;
  123. }
  124. }
  125. }
  126. .gf-form--v-stretch {
  127. align-items: stretch;
  128. }
  129. .gf-form-btn {
  130. margin-right: $gf-form-margin;
  131. padding: $input-padding-y $input-padding-x;
  132. line-height: $input-line-height;
  133. flex-shrink: 0;
  134. flex-grow: 0;
  135. }
  136. .gf-form-switch {
  137. margin-right: $gf-form-margin;
  138. }
  139. .natural-language-input {
  140. &input[type="number"] {
  141. font-size: $font-size-base;
  142. line-height: $input-line-height;
  143. margin: -6px -5px 0 5px;
  144. padding: $input-padding-y/2 $input-padding-x/2;
  145. }
  146. }
  147. .gf-form-dropdown-typeahead {
  148. margin-right: $gf-form-margin;
  149. position: relative;
  150. background-color: $input-bg;
  151. padding-right: $input-padding-x;
  152. &:after {
  153. position: absolute;
  154. top: 35%;
  155. right: $input-padding-x/2;
  156. background-color: transparent;
  157. color: $input-color;
  158. font: normal normal normal $font-size-sm/1 FontAwesome;
  159. content: '\f0d7';
  160. pointer-events: none;
  161. }
  162. }
  163. .gf-form-help-icon {
  164. flex-grow: 0;
  165. padding-left: $spacer;
  166. color: $text-color-weak;
  167. &--right-absolute {
  168. position: absolute;
  169. right: $spacer;
  170. top: 8px;
  171. }
  172. &--right-normal {
  173. float: right;
  174. }
  175. }
  176. select.gf-form-input ~ .gf-form-help-icon {
  177. right: 10px;
  178. }