_gf-form.scss 4.9 KB

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