_gf-form.scss 7.4 KB

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