_gf-form.scss 7.5 KB

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