Skip to content

Instantly share code, notes, and snippets.

@davemac
Created July 9, 2018 23:32
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 davemac/774aa7655e2798c2a855b625b2e5bb0f to your computer and use it in GitHub Desktop.
Save davemac/774aa7655e2798c2a855b625b2e5bb0f to your computer and use it in GitHub Desktop.
Example css grid card layout
.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