Today, I was working on a flex-grid generator in scss
, which is something I do often. However, I encountered an unexpected error this time. I am using a 12-col-grid
system and my approach should work fine with the code flex: 0 0 #{100 / 12 / $i}%;
. There must be something obvious that I'm missing. If you want to take a look at my Codepen, here's the link: My Codepen.
@mixin colSpan {
@for $i from 1 through 12 {
.col-#{$i} {
flex: 0 0 #{100 / 12 / $i}%;
max-width: #{100 / 12 / $i}%;
}
}
}
@include colSpan;