_gf-form.scss 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  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: center;
  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. min-height: 2.6rem;
  92. }
  93. &--error {
  94. color: $critical;
  95. }
  96. &--small {
  97. padding: ($input-padding-y / 2) ($input-padding-x / 2);
  98. font-size: $font-size-xs;
  99. }
  100. &:disabled {
  101. color: $text-color-weak;
  102. }
  103. }
  104. .gf-form-label + .gf-form-label {
  105. margin-right: $gf-form-margin;
  106. }
  107. .gf-form-pre {
  108. display: block;
  109. flex-grow: 1;
  110. margin: 0;
  111. margin-right: $gf-form-margin;
  112. border: $input-btn-border-width solid transparent;
  113. border-left: none;
  114. @include border-radius($label-border-radius-sm);
  115. }
  116. .gf-form-checkbox {
  117. flex-shrink: 0;
  118. padding: $input-padding-y $input-padding-x;
  119. line-height: $input-line-height;
  120. .checkbox-label {
  121. display: inline;
  122. cursor: pointer;
  123. padding: $input-padding-y 0.4rem;
  124. line-height: $input-line-height;
  125. }
  126. }
  127. .gf-form-textarea {
  128. max-width: 650px;
  129. }
  130. .gf-form-input {
  131. display: block;
  132. width: 100%;
  133. height: $gf-form-input-height;
  134. padding: $input-padding-y $input-padding-x;
  135. font-size: $font-size-md;
  136. line-height: $input-line-height;
  137. color: $input-color;
  138. background-color: $input-bg;
  139. background-image: none;
  140. background-clip: padding-box;
  141. border: $input-border;
  142. border-radius: $input-border-radius;
  143. @include box-shadow($input-box-shadow);
  144. white-space: nowrap;
  145. overflow: hidden;
  146. text-overflow: ellipsis;
  147. // text areas should be scrollable
  148. @at-root textarea#{&} {
  149. overflow: auto;
  150. white-space: pre-wrap;
  151. height: auto;
  152. }
  153. // Unstyle the caret on `<select>`s in IE10+.
  154. &::-ms-expand {
  155. background-color: transparent;
  156. border: 0;
  157. display: none;
  158. }
  159. &.gf-input-small {
  160. padding: $input-padding-y/3 $input-padding-x/3;
  161. font-size: $font-size-xs;
  162. }
  163. // Customize the `:focus` state to imitate native WebKit styles.
  164. @include form-control-focus();
  165. // Placeholder
  166. &::placeholder {
  167. color: $input-color-placeholder;
  168. opacity: 1;
  169. }
  170. &:disabled,
  171. &[readonly] {
  172. background-color: $input-bg-disabled;
  173. // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
  174. opacity: 1;
  175. }
  176. &:disabled {
  177. cursor: $cursor-disabled;
  178. }
  179. &.gf-size-auto {
  180. width: auto;
  181. }
  182. &--dropdown {
  183. padding-right: $input-padding-x*2;
  184. &::after {
  185. position: absolute;
  186. top: 36%;
  187. right: 11px;
  188. font-size: 11px;
  189. background-color: transparent;
  190. color: $text-color;
  191. font: normal normal normal $font-size-sm/1 FontAwesome;
  192. content: '\f0d7';
  193. pointer-events: none;
  194. }
  195. }
  196. &--small {
  197. padding-top: 4px;
  198. padding-bottom: 4px;
  199. font-size: $font-size-sm;
  200. }
  201. &--plaintext {
  202. white-space: unset;
  203. }
  204. }
  205. .gf-form-hint {
  206. width: 100%;
  207. }
  208. .gf-form-hint-text {
  209. display: block;
  210. text-align: right;
  211. padding-top: 0.5em;
  212. }
  213. .gf-form-select-wrapper {
  214. margin-right: $gf-form-margin;
  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. }
  325. select.gf-form-input ~ .gf-form-help-icon {
  326. right: 10px;
  327. }
  328. .gf-form-icon--right-absolute {
  329. position: absolute;
  330. right: $spacer;
  331. top: 10px;
  332. color: $text-muted;
  333. }
  334. .cta-form {
  335. position: relative;
  336. padding: 1.5rem;
  337. background-color: $empty-list-cta-bg;
  338. margin-bottom: 2rem;
  339. border-top: 3px solid $green;
  340. }
  341. .cta-form__close {
  342. background: transparent;
  343. padding: 4px 8px 4px 9px;
  344. border: none;
  345. position: absolute;
  346. right: 0;
  347. top: -2px;
  348. font-size: $font-size-md;
  349. &:hover {
  350. color: $text-color-strong;
  351. }
  352. }
  353. .cta-form__bar {
  354. display: flex;
  355. align-items: center;
  356. align-content: center;
  357. margin-bottom: 20px;
  358. }
  359. .cta-form__bar-header {
  360. font-size: $font-size-h4;
  361. padding-right: 20px;
  362. }