_gf-form.scss 7.3 KB

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