_gf-form.scss 7.9 KB

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