Skip to content

Instantly share code, notes, and snippets.

@mandymichael
Last active January 6, 2020 02:06
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 mandymichael/fa2928fb46088acc52a743ba837a013f to your computer and use it in GitHub Desktop.
Save mandymichael/fa2928fb46088acc52a743ba837a013f to your computer and use it in GitHub Desktop.
Collection Adding Borders
export const Collection = styled('div')(({ theme }) => ({
display: 'grid',
gridGap: 12,
gridTemplateColumns: '1fr',
paddingBottom: 8,
borderBottom: '4px double grey',
'& > div:not(:first-child)': {
position: 'relative',
'&::after': {
content: `''`,
height: '100%',
width: 1,
transform: 'translateX(-6px)',
position: 'absolute',
bottom: 0,
left: 0,
backgroundColor: lightgrey,
},
},
[breakpoint('sm')]: {
gridTemplateColumns: 'repeat(2, 1fr)',
},
[breakpoint('md')]: {
gridTemplateColumns: 'repeat(4, 1fr)',
},
}))
// For nested cards within a column add a bottom border
export const CardContainer = styled('div')(
({ theme }) => ({
display: 'flex',
flexGrow: 1,
flexShrink: 1,
flexWrap: 'wrap',
flexDirection: 'column',
justifyContent: 'flex-start',
'& > *:not(:last-child)': {
borderBottom: `1px solid grey`,
},
}),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment