Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forms spacing when outside form builder #825

Merged
merged 1 commit into from
May 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/@sanity/components/src/fieldsets/story.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,17 @@ storiesOf('Fieldsets')
</Sanity>
)
})
.add('Spacing test', () => {
return (
<div style={{margin: '1rem'}}>
<Fieldset legend="Test" description={chance.paragraph()}>
<DefaultTextField label="Label" placeholder="Placeholder" />
<DefaultTextField label="Label" placeholder="Placeholder" />
</Fieldset>
<Fieldset legend="Test 2" description={chance.paragraph()}>
<DefaultTextField label="Label" placeholder="Placeholder" />
</Fieldset>
<Fieldset legend="Test 3" description={chance.paragraph()} />
</div>
)
})
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
}
}

.root + .root {
margin-top: var(--medium-padding);
}

.fieldset {
margin: 0;
padding: 0;
Expand Down
19 changes: 18 additions & 1 deletion packages/@sanity/components/src/formfields/story.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ storiesOf('Form fields')
<DefaultFormField
label={text('label (prop)', 'This is the label')}
description={text('Description (prop)', 'This is the description')}
labelFor={id}
level={number('Level (prop)', 0)}
inline={boolean('Inline (prop)', false)}
wrapped={boolean('Wrapped (prop)', false)}
Expand All @@ -25,3 +24,21 @@ storiesOf('Form fields')
</Sanity>
)
})
.add('Spacing test', () => {
return (
<div style={{margin: '1rem'}}>
<DefaultFormField label="Label" description="Description">
<DefaultTextInput value="" />
</DefaultFormField>
<DefaultFormField label="Label" description="Description">
<DefaultTextInput value="" />
</DefaultFormField>
<DefaultFormField label="Label" description="Description">
<DefaultTextInput value="" />
</DefaultFormField>
<DefaultFormField label="Label" description="Description">
<DefaultTextInput value="" />
</DefaultFormField>
</div>
)
})
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
box-sizing: border-box;
}

.root + .root {
margin-top: var(--medium-padding);
}

.block {
display: block;
}
Expand Down
10 changes: 10 additions & 0 deletions packages/@sanity/components/src/textfields/story.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,13 @@ storiesOf('Textfields')
</Sanity>
)
})
.add('Spacing test', () => {
return (
<div style={{margin: '1rem'}}>
<DefaultTextField label="Label" placeholder="Placeholder" />
<DefaultTextField label="Label" placeholder="Placeholder" />
<DefaultTextField label="Label" placeholder="Placeholder" />
<DefaultTextField label="Label" placeholder="Placeholder" />
</div>
)
})