Skip to content

Instantly share code, notes, and snippets.

@jepser
Created May 28, 2019 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jepser/1ba2f6cde3a9ae7ad03c06ac38921c44 to your computer and use it in GitHub Desktop.
Save jepser/1ba2f6cde3a9ae7ad03c06ac38921c44 to your computer and use it in GitHub Desktop.
const baseStyles = ({ top, left, right, bottom }) => css`
margin-top: ${top ? unitizedPx(top) : null};
margin-right: ${right ? unitizedPx(right) : null};
margin-bottom: ${bottom ? unitizedPx(bottom) : null};
margin-left: ${left ? unitizedPx(left) : null};
`;
const responsiveStyles = generateResponsiveStyles(baseStyles);
export const Root = styled.div`
display: ${props => (props.inline ? 'inline-block' : 'block')};
${baseStyles}
${responsiveStyles}
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment