_gf-form.scss 7.2 KB

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