_gf-form.scss 7.2 KB

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