_gf-form.scss 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. $gf-form-margin: 3px;
  2. $input-border: 1px solid $input-border-color;
  3. .gf-form {
  4. margin-bottom: $gf-form-margin;
  5. display: flex;
  6. flex-direction: row;
  7. align-items: center;
  8. text-align: left;
  9. position: relative;
  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. &--alt {
  20. flex-direction: column;
  21. align-items: flex-start;
  22. .gf-form-label {
  23. padding: 4px 0;
  24. }
  25. }
  26. }
  27. .gf-form--has-input-icon {
  28. position: relative;
  29. margin-right: $gf-form-margin;
  30. .gf-form-input-icon {
  31. position: absolute;
  32. top: 50%;
  33. margin-top: -9px;
  34. font-size: $font-size-lg;
  35. left: 10px;
  36. color: $input-color-placeholder;
  37. }
  38. > input {
  39. padding-left: 35px;
  40. &:focus + .gf-form-input-icon {
  41. color: $text-muted;
  42. }
  43. }
  44. .Select--multi .Select-multi-value-wrapper,
  45. .Select-placeholder {
  46. padding-left: 30px;
  47. }
  48. }
  49. .gf-form-disabled {
  50. color: $text-color-weak;
  51. .gf-form-select-wrapper::after {
  52. color: $text-color-weak;
  53. }
  54. a,
  55. .gf-form-input {
  56. color: $text-color-weak;
  57. }
  58. }
  59. .gf-form-group {
  60. margin-bottom: $spacer * 2.5;
  61. }
  62. .gf-form-inline {
  63. display: flex;
  64. flex-direction: row;
  65. flex-wrap: wrap;
  66. align-content: flex-start;
  67. .gf-form + .gf-form {
  68. margin-right: $gf-form-margin;
  69. }
  70. }
  71. .gf-form-button-row {
  72. padding-top: $spacer * 1.5;
  73. a,
  74. button {
  75. margin-right: $spacer;
  76. }
  77. }
  78. .gf-form-label {
  79. padding: $input-padding-y $input-padding-x;
  80. flex-shrink: 0;
  81. font-weight: $font-weight-semi-bold;
  82. font-size: $font-size-sm;
  83. background-color: $input-label-bg;
  84. display: block;
  85. border: $input-btn-border-width solid $input-label-border-color;
  86. border-right: none;
  87. border-radius: $label-border-radius;
  88. &--grow {
  89. flex-grow: 1;
  90. min-height: 2.6rem;
  91. }
  92. &--error {
  93. color: $critical;
  94. }
  95. &--small {
  96. padding: ($input-padding-y / 2) ($input-padding-x / 2);
  97. font-size: $font-size-xs;
  98. }
  99. &:disabled {
  100. color: $text-color-weak;
  101. }
  102. }
  103. .gf-form-label + .gf-form-label {
  104. margin-right: $gf-form-margin;
  105. }
  106. .gf-form-pre {
  107. display: block;
  108. flex-grow: 1;
  109. margin: 0;
  110. margin-right: $gf-form-margin;
  111. border: $input-btn-border-width solid transparent;
  112. border-left: none;
  113. @include border-radius($label-border-radius-sm);
  114. }
  115. .gf-form-checkbox {
  116. flex-shrink: 0;
  117. padding: $input-padding-y $input-padding-x;
  118. line-height: $input-line-height;
  119. .checkbox-label {
  120. display: inline;
  121. cursor: pointer;
  122. padding: $input-padding-y 0.4rem;
  123. line-height: $input-line-height;
  124. }
  125. }
  126. .gf-form-textarea {
  127. max-width: 650px;
  128. }
  129. .gf-form-input {
  130. display: block;
  131. width: 100%;
  132. padding: $input-padding-y $input-padding-x;
  133. margin-right: $gf-form-margin;
  134. font-size: $font-size-md;
  135. line-height: $input-line-height;
  136. color: $input-color;
  137. background-color: $input-bg;
  138. background-image: none;
  139. background-clip: padding-box;
  140. border: $input-border;
  141. border-radius: $input-border-radius;
  142. @include box-shadow($input-box-shadow);
  143. white-space: nowrap;
  144. overflow: hidden;
  145. text-overflow: ellipsis;
  146. // text areas should be scrollable
  147. @at-root textarea#{&} {
  148. overflow: auto;
  149. white-space: pre-wrap;
  150. }
  151. // Unstyle the caret on `<select>`s in IE10+.
  152. &::-ms-expand {
  153. background-color: transparent;
  154. border: 0;
  155. display: none;
  156. }
  157. &.gf-input-small {
  158. padding: $input-padding-y/3 $input-padding-x/3;
  159. font-size: $font-size-xs;
  160. }
  161. // Customize the `:focus` state to imitate native WebKit styles.
  162. @include form-control-focus();
  163. // Placeholder
  164. &::placeholder {
  165. color: $input-color-placeholder;
  166. opacity: 1;
  167. }
  168. &:disabled,
  169. &[readonly] {
  170. background-color: $input-bg-disabled;
  171. // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
  172. opacity: 1;
  173. }
  174. &:disabled {
  175. cursor: $cursor-disabled;
  176. }
  177. &.gf-size-auto {
  178. width: auto;
  179. }
  180. &--dropdown {
  181. padding-right: $input-padding-x*2;
  182. &::after {
  183. position: absolute;
  184. top: 36%;
  185. right: 11px;
  186. font-size: 11px;
  187. background-color: transparent;
  188. color: $text-color;
  189. font: normal normal normal $font-size-sm/1 FontAwesome;
  190. content: '\f0d7';
  191. pointer-events: none;
  192. }
  193. }
  194. &--small {
  195. padding-top: 4px;
  196. padding-bottom: 4px;
  197. font-size: $font-size-sm;
  198. }
  199. &--plaintext {
  200. white-space: unset;
  201. }
  202. }
  203. .gf-form-hint {
  204. width: 100%;
  205. }
  206. .gf-form-hint-text {
  207. display: block;
  208. text-align: right;
  209. padding-top: 0.5em;
  210. }
  211. .gf-form-select-wrapper {
  212. margin-right: $gf-form-margin;
  213. position: relative;
  214. background-color: $input-bg;
  215. .gf-form-select-icon {
  216. position: absolute;
  217. z-index: 1;
  218. left: $input-padding-x;
  219. top: 50%;
  220. margin-top: -7px;
  221. & + .gf-form-input {
  222. position: relative;
  223. z-index: 2;
  224. padding-left: $input-padding-x*3;
  225. background-color: transparent;
  226. option {
  227. // Firefox
  228. color: $black;
  229. }
  230. }
  231. }
  232. .gf-form-input {
  233. margin-right: 0;
  234. }
  235. select.gf-form-input {
  236. text-indent: 0.01px;
  237. text-overflow: '';
  238. padding-right: $input-padding-x*3;
  239. appearance: none;
  240. &:-moz-focusring {
  241. outline: none;
  242. color: transparent;
  243. text-shadow: 0 0 0 $text-color;
  244. }
  245. &.ng-empty {
  246. color: $text-color-weak;
  247. }
  248. }
  249. &::after {
  250. position: absolute;
  251. top: 36%;
  252. right: 11px;
  253. background-color: transparent;
  254. color: $text-color;
  255. font: normal normal normal $font-size-sm/1 FontAwesome;
  256. content: '\f0d7';
  257. pointer-events: none;
  258. font-size: 11px;
  259. }
  260. &--has-help-icon {
  261. &::after {
  262. right: $input-padding-x*3;
  263. }
  264. }
  265. }
  266. .gf-form--v-stretch {
  267. align-items: stretch;
  268. }
  269. .gf-form-btn {
  270. padding: $input-padding-y $input-padding-x;
  271. margin-right: $gf-form-margin;
  272. line-height: $input-line-height;
  273. font-size: $font-size-sm;
  274. flex-shrink: 0;
  275. flex-grow: 0;
  276. }
  277. .natural-language-input {
  278. &input[type='number'] {
  279. font-size: $font-size-base;
  280. line-height: $input-line-height;
  281. margin: -6px -5px 0 5px;
  282. padding: $input-padding-y/2 $input-padding-x/2;
  283. }
  284. }
  285. .gf-form-dropdown-typeahead {
  286. margin-right: $gf-form-margin;
  287. position: relative;
  288. background-color: $input-bg;
  289. border: $input-border;
  290. border-radius: $input-border-radius;
  291. &::after {
  292. position: absolute;
  293. top: 35%;
  294. right: $input-padding-x;
  295. background-color: transparent;
  296. color: $input-color;
  297. font: normal normal normal $font-size-sm/1 FontAwesome;
  298. content: '\f0d7';
  299. pointer-events: none;
  300. font-size: 11px;
  301. }
  302. .gf-form-input {
  303. border: none;
  304. }
  305. }
  306. .gf-form-help-icon {
  307. flex-grow: 0;
  308. padding-left: $spacer;
  309. color: $text-color-weak;
  310. &--bold {
  311. color: $text-color-emphasis;
  312. padding-left: 0;
  313. }
  314. &--right-absolute {
  315. position: absolute;
  316. right: $spacer;
  317. top: 10px;
  318. }
  319. &--right-normal {
  320. float: right;
  321. }
  322. &--header {
  323. margin-bottom: $gf-form-margin;
  324. }
  325. &--no-padding {
  326. padding-left: 0;
  327. }
  328. }
  329. select.gf-form-input ~ .gf-form-help-icon {
  330. right: 10px;
  331. }
  332. .gf-form-icon--right-absolute {
  333. position: absolute;
  334. right: $spacer;
  335. top: 10px;
  336. color: $text-muted;
  337. }
  338. .cta-form {
  339. position: relative;
  340. padding: 1.5rem;
  341. background-color: $empty-list-cta-bg;
  342. margin-bottom: 2rem;
  343. border-top: 3px solid $green;
  344. }
  345. .cta-form__close {
  346. position: absolute;
  347. right: 0;
  348. top: 0;
  349. }