Merge pull request #614 from sharetribe/fix-form-baselines

Form elements should be divisible by 8 (desktop) or 6px (mobile)
This commit is contained in:
Vesa Luusua 2017-12-22 11:58:45 +02:00 committed by GitHub
commit 506b7fe023
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 136 additions and 58 deletions

View file

@ -22,6 +22,7 @@
@media (--viewportMedium) {
margin-top: 0;
margin-bottom: 34px;
padding: 0;
}
}

View file

@ -16,8 +16,4 @@
}
.textarea {
@media (--viewportMedium) {
/* Fix baseline alignment */
padding-top: 6px;
}
}

View file

@ -3,6 +3,12 @@
.root {
@apply --marketplaceH4FontStyles;
margin-top: 6px;
margin-bottom: 12px;
color: var(--failColor);
overflow: hidden;
@media (--viewportMedium) {
margin-top: 6px;
margin-bottom: 10px;
}
}

View file

@ -44,6 +44,7 @@
@media (--viewportMedium) {
margin-top: 30px;
padding-top: 2px;
}
}

View file

@ -30,6 +30,7 @@
@media (--viewportMedium) {
margin-bottom: 56px;
padding-top: 0;
}
}
@ -40,10 +41,6 @@
margin-bottom: 60px;
padding: 0;
opacity: 0;
@media (--viewportLarge) {
padding: 4px 0 0 0;
}
}
.confirmChangesSectionVisible {
@ -106,12 +103,9 @@
@media (--viewportMedium) {
margin-top: 0;
margin-bottom: 14px;
}
@media (--viewportMedium) {
margin-top: 0;
margin-bottom: 20px;
margin-bottom: 16px;
padding-top: 4px;
padding-bottom: 4px;
}
}
@ -120,7 +114,7 @@
margin-bottom: 37px;
@media (--viewportMedium) {
margin-bottom: 46px;
margin-bottom: 48px;
}
}

View file

@ -24,4 +24,8 @@
margin-top: 2px;
margin-bottom: 47px;
}
@media (--viewportLarge) {
margin-top: 4px;
}
}

View file

@ -1,25 +1,47 @@
@import '../../marketplace.css';
:root {
--formMargins: {
margin-bottom: 24px;
@media (--viewportMedium) {
margin-bottom: 32px;
}
}
}
.root {
/* Dimensions */
width: 100%;
height: auto;
/* Layout */
display: flex;
flex: 1;
flex-direction: column;
padding-top: 1px;
@media (--viewportMedium) {
padding-top: 2px;
}
}
.error {
color: var(--failColor);
}
.description {
flex-shrink: 0;
margin-top: 24px;
margin-bottom: 24px;
.title {
@apply --formMargins;
}
@media (--viewportMedium) {
margin-top: 30px;
}
.description {
@apply --formMargins;
flex-shrink: 0;
}
.category {
@apply --formMargins;
}
.submitButton {

View file

@ -65,6 +65,7 @@ const EditListingDescriptionFormComponent = props => {
<Form className={classes} onSubmit={handleSubmit}>
{errorMessage}
<TextInputField
className={css.title}
type="text"
name="title"
id={`${form}.title`}
@ -85,7 +86,11 @@ const EditListingDescriptionFormComponent = props => {
validate={[required(descriptionRequiredMessage)]}
/>
<FieldCustomAttributeSelect id={`${form}.category`} customAttribute="category" />
<FieldCustomAttributeSelect
className={css.category}
id={`${form}.category`}
customAttribute="category"
/>
<Button
className={css.submitButton}

View file

@ -1,11 +1,27 @@
@import '../../marketplace.css';
:root {
--formMargins: {
margin-bottom: 24px;
@media (--viewportMedium) {
margin-bottom: 32px;
}
}
}
.root {
/* Dimensions */
width: 100%;
height: auto;
/* Display format */
display: flex;
flex: 1;
flex-direction: column;
@media (--viewportMedium) {
padding-top: 2px;
}
}
.error {
@ -22,6 +38,10 @@
border-bottom-color: var(--matterColorDark);
outline: none;
}
@media (--viewportMedium) {
height: 40px;
}
}
.locationAutocompleteInputIcon {
@ -39,18 +59,23 @@
border-bottom-right-radius: var(--borderRadius);
box-shadow: var(--boxShadowPopup);
z-index: var(--zIndexPopup + 1);
@media (--viewportMedium) {
top: 40px;
}
}
.validLocation {
border-bottom-color: var(--successColor);
}
.locationAddress,
.building {
flex-shrink: 0;
margin-top: 24px;
margin-bottom: 24px;
@media (--viewportMedium) {
margin-top: 28px;
margin-bottom: 32px;
}
}

View file

@ -57,6 +57,7 @@ export const EditListingLocationFormComponent = props => {
<Form className={classes} onSubmit={handleSubmit}>
{errorMessage}
<LocationAutocompleteInputField
className={css.locationAddress}
inputClassName={css.locationAutocompleteInput}
iconClassName={css.locationAutocompleteInputIcon}
predictionsClassName={css.predictionsRoot}

View file

@ -1,12 +1,17 @@
@import '../../marketplace.css';
.root {
/* Dimensions */
width: 100%;
height: auto;
display: flex;
flex: 1;
flex-direction: column;
flex-grow: 1;
@media (--viewportMedium) {
padding-top: 2px;
}
}
.error {

View file

@ -10,6 +10,7 @@
@media (--viewportMedium) {
margin-bottom: 56px;
padding-top: 0;
}
}
@ -20,10 +21,6 @@
margin-bottom: 60px;
padding: 0;
opacity: 0;
@media (--viewportLarge) {
padding: 4px 0 0 0;
}
}
.confirmChangesSectionVisible {
@ -39,12 +36,9 @@
@media (--viewportMedium) {
margin-top: 0;
margin-bottom: 14px;
}
@media (--viewportMedium) {
margin-top: 0;
margin-bottom: 20px;
margin-bottom: 16px;
padding-top: 4px;
padding-bottom: 4px;
}
}
@ -53,7 +47,7 @@
margin-bottom: 37px;
@media (--viewportMedium) {
margin-bottom: 46px;
margin-bottom: 48px;
}
}

View file

@ -24,4 +24,8 @@
margin-top: 2px;
margin-bottom: 47px;
}
@media (--viewportLarge) {
margin-top: 4px;
}
}

View file

@ -20,7 +20,9 @@
@media (--viewportMedium) {
margin-top: 0;
margin-bottom: 17px;
margin-bottom: 16px;
padding-top: 4px;
padding-bottom: 4px;
}
}

View file

@ -6,20 +6,20 @@
}
.root {
margin-top: 23px;
margin-top: 24px;
@media (--viewportMedium) {
margin-top: 35px;
margin-top: 32px;
}
}
.sectionContainer {
padding: 0;
margin-bottom: 37px;
margin-bottom: 36px;
@media (--viewportMedium) {
padding: 0;
margin-bottom: 54px;
margin-bottom: 56px;
}
}
@ -28,26 +28,26 @@
color: var(--matterColorAnti);
margin-top: 0;
margin-bottom: 13px;
margin-bottom: 12px;
padding-top: 3px;
padding-bottom: 3px;
@media (--viewportMedium) {
margin-top: 0;
margin-bottom: 20px;
margin-bottom: 24px;
padding-top: 4px;
padding-bottom: 4px;
}
}
.lastSection {
/* Fix baseline alignment */
padding-top: 3px;
margin-bottom: 69px;
@media (--viewportMedium) {
padding-top: 6px;
margin-bottom: 111px;
& .sectionTitle {
margin-bottom: 18px;
margin-bottom: 16px;
}
}
}
@ -57,7 +57,7 @@
}
.uploadAvatarWrapper {
margin-top: 19px;
margin-top: 18px;
margin-bottom: 18px;
@media (--viewportMedium) {
@ -248,11 +248,15 @@
@apply --marketplaceDefaultFontStyles;
color: var(--matterColorAnti);
margin-top: 0;
margin-bottom: 16px;
margin-bottom: 12px;
padding-top: 5px;
padding-bottom: 1px;
@media (--viewportMedium) {
margin-top: 0;
margin-bottom: 11px;
margin-bottom: 8px;
padding-top: 4px;
padding-bottom: 4px;
}
}
@ -261,20 +265,24 @@
color: var(--matterColorAnti);
margin-top: 0;
margin-bottom: 0;
padding-top: 5px;
padding-bottom: 1px;
@media (--viewportMedium) {
margin-top: 0;
margin-bottom: 0;
padding-top: 6px;
padding-bottom: 2px;
}
}
.nameContainer {
display: flex;
justify-content: space-between;
margin-top: 14px;
margin-top: 12px;
@media (--viewportMedium) {
margin-top: 26px;
margin-top: 24px;
}
}
@ -291,7 +299,7 @@
margin-top: 11px;
@media (--viewportMedium) {
margin-top: 13px;
margin-top: 16px;
}
}

View file

@ -9,7 +9,7 @@
@media (--viewportMedium) {
max-width: 565px;
margin: 56px auto;
margin: 55px auto 56px auto;
}
}

View file

@ -10,7 +10,7 @@
margin-top: 24px;
@media (--viewportMedium) {
margin-top: 30px;
margin-top: 32px;
}
}

View file

@ -266,7 +266,7 @@
}
@media (--viewportMedium) {
padding: 6px 0 10px 0;
padding: 4px 0 10px 0;
}
}
@ -302,6 +302,10 @@
border-bottom-color: var(--matterColor);
outline: none;
}
@media (--viewportMedium) {
padding: 4px 0 10px 0;
}
}
/* ================ Modals ================ */
@ -538,7 +542,7 @@
margin-top: 24px;
@media (--viewportMedium) {
margin-top: 30px;
margin-top: 32px;
}
}
}

View file

@ -83,6 +83,8 @@ label {
font-weight: var(--fontWeightSemiBold);
margin-top: 0;
margin-bottom: 0;
padding-top: 6px;
padding-bottom: 2px;
}
}
@ -108,6 +110,10 @@ textarea {
&::placeholder {
padding: 0 0 10px 0;
}
@media (--viewportMedium) {
padding: 4px 0 10px 0;
}
}
:global(.fontsLoaded) {