_gf-form.scss 7.5 KB

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