Breakpoint on padding

This commit is contained in:
Ezekiel Aquino
2018-11-30 15:23:26 +01:00
parent 6bf9889429
commit 7962e4050c
2 changed files with 7 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ interface SectionProps {
interface WrapProps {
width?: 'default' | 'full' | 'medium' | 'narrow';
bgColor?: string;
margin?: number | ('large' | 'default' | number)[];
padding?: number | ('large' | 'default' | number)[];
}
interface ColumnProps {
@@ -99,11 +99,15 @@ export const Section = styled.section<SectionProps>`
width: ${props => props.fullWidth && '100vw'};
margin-left: ${props => props.fullWidth && `calc(750px - 50vw)`};
}
@media (max-width: ${BREAKPOINTS.mobile}) {
padding: 30px;
}
`;
const WrapBase = styled.div<WrapProps>`
max-width: ${props => WRAPPER_WIDTHS[props.width || 'default']};
padding: ${props => props.margin && _getPadding(props.margin)};
padding: ${props => props.padding && _getPadding(props.padding)};
background-color: ${props => props.bgColor};
margin: 0 auto;
`;

View File

@@ -72,7 +72,7 @@ export const NextLanding = () => (
</WrapCentered>
{/* Note you can also pass in a string "large/default" or a number for custom margins */}
<Wrap margin={['large', 0, 0, 0]}>
<Wrap padding={['large', 0, 0, 0]}>
{/* NOTE: this probably should be withComponent as part of a <dl> */}
<Column colWidth="1/3" noPadding>
<Heading size="medium" center>