Sass column sizes mixin
<p>I'm writing a mixin to create a bunch of column size classes, this is the code I've got so far:</p>

<pre><code>.col {
    @for $span from 1 through 12 {
        @for $total from 1 through 12 {
            @if $total &gt; $span {
                &amp;--#{$span}of#{$total} {
                    width: percentage($span/$total);
                }
            }
        }
    }
}
</code></pre>

<p>This outputs classes  of <code>.col--XofX</code>, where x is each number between 1 and 12.
This means my classes are coming out like these examples:</p>

<pre><code>.col--1of1
.col--1of2
.col--1of3
</code></pre>

<p>Etc, all the way to <code>1of12</code>.</p>

<p>I am also getting classes of:</p>

<pre><code>.col--5of8
.col--7of10
.col--10of12
</code></pre>

<p>Etc, as long as the <code>$span</code> is a smaller number than the <code>$total</code>, again, up to 12.</p>

<p>What I'm wondering is if there is a better way of writing this mixin, such as passing in the 1 through 12 for each property, something like the below idea. Also I wouldn't want classes where the span is larger than the total, so I don't want `.col--8of1' etc.</p>

<pre><code>$span: 1 through 12
$total: 1 through 12
@mixin create-cols($span, $total) {
    .col--#{$span}of#{$total} {}
}
</code></pre>

<p>Thanks!</p>