Skip to content

Instantly share code, notes, and snippets.

@maxbrockman453
Created June 12, 2014 21:27
Show Gist options
  • Save maxbrockman453/1f4d1b4b5ec41d9fdc99 to your computer and use it in GitHub Desktop.
Save maxbrockman453/1f4d1b4b5ec41d9fdc99 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v0.8.6)
// ----
// Exmple While Loop
@mixin spans($args) {
$columns: $args;
$col-val: length($columns);
@for $i from 1 through $col-val {
.span-#{nth($columns, $i)} {
width: ((100 / $col-val) * $i) * 1%;
}
}
}
@include spans(one two three four five six seven eight nine ten);
.span-one {
width: 10%; }
.span-two {
width: 20%; }
.span-three {
width: 30%; }
.span-four {
width: 40%; }
.span-five {
width: 50%; }
.span-six {
width: 60%; }
.span-seven {
width: 70%; }
.span-eight {
width: 80%; }
.span-nine {
width: 90%; }
.span-ten {
width: 100%; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment