Last active
October 11, 2021 09:22
-
-
Save ryangoree/357cb5d0caf52c3ef87108c484812722 to your computer and use it in GitHub Desktop.
Sass Grid Mixin
This file contains 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
@mixin grid($cols, $rowGap: 0, $colGap: 0, $flexGrow: false) { | |
display: flex; | |
gap: #{$rowGap}px #{$colGap}px; | |
flex-wrap: wrap; | |
.col { | |
flex-basis: calc((100% - #{$colGap}px * (#{$cols} - 1)) / #{$cols}); | |
@if $flexGrow == true { | |
flex-grow: 1; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment