_gf-form.scss 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  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;
  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;
  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. // Customize the `:focus` state to imitate native WebKit styles.
  163. @include form-control-focus();
  164. // Placeholder
  165. &::placeholder {
  166. color: $input-color-placeholder;
  167. opacity: 1;
  168. }
  169. &:disabled,
  170. &[readonly] {
  171. background-color: $input-bg-disabled;
  172. // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
  173. opacity: 1;
  174. }
  175. &:disabled {
  176. cursor: $cursor-disabled;
  177. }
  178. &.gf-size-auto {
  179. width: auto;
  180. }
  181. &--dropdown {
  182. padding-right: $space-lg;
  183. &::after {
  184. position: absolute;
  185. top: 36%;
  186. right: 11px;
  187. font-size: 11px;
  188. background-color: transparent;
  189. color: $text-color;
  190. font: normal normal normal $font-size-sm/1 FontAwesome;
  191. content: '\f0d7';
  192. pointer-events: none;
  193. }
  194. }
  195. &--small {
  196. padding-top: 4px;
  197. padding-bottom: 4px;
  198. font-size: $font-size-sm;
  199. }
  200. &--plaintext {
  201. white-space: unset;
  202. }
  203. &--has-help-icon {
  204. padding-right: $space-xl;
  205. }
  206. }
  207. .gf-form-hint {
  208. width: 100%;
  209. }
  210. .gf-form-hint-text {
  211. display: block;
  212. text-align: right;
  213. padding-top: 0.5em;
  214. }
  215. .gf-form-select-wrapper {
  216. position: relative;
  217. background-color: $input-bg;
  218. .gf-form-select-icon {
  219. position: absolute;
  220. z-index: 1;
  221. left: $input-padding;
  222. top: 50%;
  223. margin-top: -7px;
  224. & + .gf-form-input {
  225. position: relative;
  226. z-index: 2;
  227. padding-left: $space-xl;
  228. background-color: transparent;
  229. option {
  230. // Firefox
  231. color: $black;
  232. }
  233. }
  234. }
  235. .gf-form-input {
  236. margin-right: 0;
  237. }
  238. select.gf-form-input {
  239. text-indent: 0.01px;
  240. text-overflow: '';
  241. padding-right: $space-xl;
  242. appearance: none;
  243. &:-moz-focusring {
  244. outline: none;
  245. color: transparent;
  246. text-shadow: 0 0 0 $text-color;
  247. }
  248. &.ng-empty {
  249. color: $text-color-weak;
  250. }
  251. }
  252. &::after {
  253. position: absolute;
  254. top: 36%;
  255. right: 11px;
  256. background-color: transparent;
  257. color: $text-color;
  258. font: normal normal normal $font-size-sm/1 FontAwesome;
  259. content: '\f0d7';
  260. pointer-events: none;
  261. font-size: 11px;
  262. }
  263. &--has-help-icon {
  264. &::after {
  265. right: $space-xl;
  266. }
  267. }
  268. }
  269. .gf-form--v-stretch {
  270. align-items: stretch;
  271. }
  272. .gf-form-btn {
  273. padding: $input-padding;
  274. margin-right: $space-xs;
  275. line-height: $input-line-height;
  276. font-size: $font-size-sm;
  277. flex-shrink: 0;
  278. flex-grow: 0;
  279. }
  280. .natural-language-input {
  281. &input[type='number'] {
  282. font-size: $font-size-base;
  283. line-height: $input-line-height;
  284. margin: -6px -5px 0 5px;
  285. padding: $space-xs;
  286. }
  287. }
  288. .gf-form-dropdown-typeahead {
  289. //margin-right: $space-xs; ?
  290. position: relative;
  291. &::after {
  292. position: absolute;
  293. top: 35%;
  294. right: $space-sm;
  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. }
  303. .gf-form-help-icon {
  304. flex-grow: 0;
  305. padding-left: $spacer;
  306. color: $text-color-weak;
  307. &--bold {
  308. color: $text-color-emphasis;
  309. padding-left: 0;
  310. }
  311. &--right-absolute {
  312. position: absolute;
  313. right: $spacer;
  314. top: 10px;
  315. }
  316. &--right-normal {
  317. float: right;
  318. }
  319. &--header {
  320. margin-bottom: $space-xxs;
  321. }
  322. &--no-padding {
  323. padding-left: 0;
  324. }
  325. &:hover {
  326. color: $text-color;
  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: $space-lg;
  341. background-color: $empty-list-cta-bg;
  342. margin-bottom: $space-lg;
  343. border-top: 3px solid $green-base;
  344. }
  345. .cta-form__close {
  346. background: transparent;
  347. padding: 4px 8px 4px 9px;
  348. border: none;
  349. position: absolute;
  350. right: 0;
  351. top: -2px;
  352. font-size: $font-size-md;
  353. &:hover {
  354. color: $text-color-strong;
  355. }
  356. }
  357. .cta-form__bar {
  358. display: flex;
  359. align-items: center;
  360. align-content: center;
  361. margin-bottom: 20px;
  362. }
  363. .cta-form__bar-header {
  364. font-size: $font-size-h4;
  365. padding-right: 20px;
  366. }