Skip to content

Instantly share code, notes, and snippets.

@StrongerMyself
Last active February 2, 2021 11:46
Show Gist options
  • Save StrongerMyself/4cbd78939d2cb2d34ddf4b18a44ff9aa to your computer and use it in GitHub Desktop.
Save StrongerMyself/4cbd78939d2cb2d34ddf4b18a44ff9aa to your computer and use it in GitHub Desktop.
$gridPad: 20px
$gridColLen: 12
.g-row
display: flex
flex-wrap: wrap
width: calc(100% + #{$gridPad})
margin-left: -#{$gridPad / 2}
margin-right: -#{$gridPad / 2}
.g-col
display: flex
align-content: flex-end
width: 100%
margin-left: #{$gridPad / 2}
margin-right: #{$gridPad / 2}
@for $i from 1 through $gridColLen
$w: 100% / $gridColLen * $i
.g-col-#{$i}
width: calc(#{$w} - #{$gridPad})
+max-screen(940px)
@for $i from 1 through $gridColLen
$w: 100% / $gridColLen * $i
.g-col-md-#{$i}
width: calc(#{$w} - #{$gridPad})
$gridPad: 10px
+max-screen(640px)
.g-row
width: calc(100% + #{$gridPad})
margin-left: -#{$gridPad / 2}
margin-right: -#{$gridPad / 2}
.g-col
margin-left: #{$gridPad / 2}
margin-right: #{$gridPad / 2}
@for $i from 1 through $gridColLen
$w: 100% / $gridColLen * $i
.g-col-xs-#{$i}
width: calc(#{$w} - #{$gridPad})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment