_gf-form.scss 5.7 KB

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