Created
July 25, 2018 14:08
-
-
Save mrcthms/ba5746abcda2116ec46ef84862a12cda to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Grid = () => ( | |
<Row> | |
<Col>I am a Col</Col> | |
<Col>I am a Col</Col> | |
<Col>I am a Col</Col> | |
<Col>I am a Col</Col> | |
<Col>I am a Col</Col> | |
<Col>I am a Col</Col> | |
<Col>I am a Col</Col> | |
<Col>I am a Col</Col> | |
<Col>I am a Col</Col> | |
<Col>I am a Col</Col> | |
<Col>I am a Col</Col> | |
<Col>I am a Col</Col> | |
<Col>I am a Col</Col> | |
<Col>I am a Col</Col> | |
<Col>I am a Col</Col> | |
</Row> | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.row { | |
display: flex; | |
flex-wrap: wrap; | |
justify-content: space-between; | |
} | |
.col { | |
width: 100%; // Single column at mobile size | |
} | |
@media (min-width: 600px) { | |
.col { | |
width: calc(50% - 24px); // 2 column with a 24px margin at 600px | |
} | |
} | |
@media (min-width: 800px) { | |
.col { | |
width: calc(33.333% - 24px) // 3 column with a 24px margin at 800px | |
} | |
} | |
@media (min-width: 1000px) { | |
.col { | |
width: calc(25% - 24px); // 4 column with a 24px margin at 1000px | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment