Skip to content

Instantly share code, notes, and snippets.

@harapeko
Last active February 26, 2019 08:47
Show Gist options
  • Save harapeko/7cb45244bb38ebe6c00d9981f2da8bcd to your computer and use it in GitHub Desktop.
Save harapeko/7cb45244bb38ebe6c00d9981f2da8bcd to your computer and use it in GitHub Desktop.
FlexGrid
.FlexGrid
$cols: 16
display: flex
&.is-reverse
flex-direction: row-reverse
&.is-start
justify-content: flex-start
text-align: start
&.is-center
justify-content: center
text-align: center
&.is-end
justify-content: flex-end
text-align: end
&.is-top
align-items: flex-start
&.is-middle
align-items: center
&.is-bottom
align-items: flex-end
&.is-around
justify-content: space-around
&.is-between
justify-content: space-between
&.is-first
order: -1
&.is-last
order: 1
&-col
flex-grow: 1
flex-basis: 0
max-width: 100%
@for $i from 1 through $cols
&-col#{$i}
flex: 0 0 auto
&.is-offset0
margin-left: 0
@for $i from 1 through $cols
&.is-offset#{$i}
margin-left: percentage($i / $cols)
@for $i from 1 through $cols
&-col#{$i}
flex-basis: percentage($i / $cols)
max-width: percentage($i / $cols)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment