Last active
December 3, 2020 22:47
-
-
Save adamrosloniec/82607ce38d235fa172c5b396f9f8a249 to your computer and use it in GitHub Desktop.
CSS - Grid-template-columns - with wrapping
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
.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