Created
July 9, 2018 23:32
-
-
Save davemac/774aa7655e2798c2a855b625b2e5bb0f to your computer and use it in GitHub Desktop.
Example css grid card layout
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
.cards { | |
display: flex; | |
align-items: stretch; | |
justify-content: space-between; | |
max-width: $row-width; | |
list-style: none; | |
margin: 0; | |
@media #{$medium-up} { | |
> * { | |
flex-basis: calc(50% - 15px); | |
} | |
} | |
@supports (display: grid) { | |
display: grid; | |
grid-template-columns: 1fr; | |
grid-gap: rem-calc(30); | |
justify-content: center; | |
@media #{$medium-up} { | |
grid-template-columns: 1fr 1fr; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment