Skip to content

Instantly share code, notes, and snippets.

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 claudia-romano/e688d514dc2b5ad3d84be87468e1271c to your computer and use it in GitHub Desktop.
Save claudia-romano/e688d514dc2b5ad3d84be87468e1271c to your computer and use it in GitHub Desktop.
$gap-horizontal: 10px;
$gap-vertical: $gap-horizontal;
@mixin grid {
// fallback for IE
&::before, &::after {
content: '';
display: table;
}
&::after {
clear: both;
}
> * {
float: left;
margin-right: $gap-horizontal;
margin-bottom: $gap-vertical;
}
@supports(grid-area: auto) {
//CSS Grid style
display: grid;
grid-column-gap: $gap-horizontal;
grid-row-gap: $gap-vertical;
&::after, &::before {
content: none;
}
> * {
margin-right: 0;
margin-bottom: 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment