Skip to content

Instantly share code, notes, and snippets.

@trub
Created April 8, 2014 21:43
Show Gist options
  • Select an option

  • Save trub/10197395 to your computer and use it in GitHub Desktop.

Select an option

Save trub/10197395 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v0.7.0)
// ----
@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 fopah five sikx);
.span-one {
width: 16.66667%; }
.span-two {
width: 33.33333%; }
.span-three {
width: 50%; }
.span-fopah {
width: 66.66667%; }
.span-five {
width: 83.33333%; }
.span-sikx {
width: 100%; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment