Skip to content

Instantly share code, notes, and snippets.

@johnnyBira
Last active March 30, 2019 16:54
Show Gist options
  • Save johnnyBira/e8550297649d40e5d21ba6ae5b5a19c3 to your computer and use it in GitHub Desktop.
Save johnnyBira/e8550297649d40e5d21ba6ae5b5a19c3 to your computer and use it in GitHub Desktop.
...
const span = (cols) => `
// calculate the width
width: ${cols / 12 * 100 }%;
`
const offset = (cols) => `
// calculate the offset
margin: ${cols / 12 * 100 }%;
`
const order = (order) => `
order: ${order};
`
const hidden = (hidden = false) => `
display: ${hidden ? 'none' : 'flex'};
`
export const withResponsiveProps(
// Wrapped styled component
Column,
// Mixins
{
span: span,
offset: offset,
order: order,
hidden: hidden
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment