Skip to content

Instantly share code, notes, and snippets.

@adamrosloniec
Last active December 3, 2020 22:47
Show Gist options
  • Save adamrosloniec/82607ce38d235fa172c5b396f9f8a249 to your computer and use it in GitHub Desktop.
Save adamrosloniec/82607ce38d235fa172c5b396f9f8a249 to your computer and use it in GitHub Desktop.
CSS - Grid-template-columns - with wrapping
.grid-tiles {
width: 100%;
display: grid;
// grid-template-columns: repeat(4, 1fr); // <- it doesn't wrap elements
grid-template-columns: repeat(4, minmax(calc(#{percentage(1/4)} - #{pxToRem(16)}), 1fr)); // <- it wrap!
grid-column-gap: pxToRem(16);
grid-row-gap: pxToRem(16);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment