Skip to content

Instantly share code, notes, and snippets.

@charliewilco
Last active August 29, 2015 14:16
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charliewilco/ae099e79a51a541bb377 to your computer and use it in GitHub Desktop.
Save charliewilco/ae099e79a51a541bb377 to your computer and use it in GitHub Desktop.
Floats Based Column Grid
// ----
// libsass (v3.1.0)
// ----
$ends: 4, 6, 8, 12;
$gutterSize: 2%;
@each $end in $ends {
@for $i from 1 through $end {
$single--column: (100 - (($end - 1)*$gutterSize )) / $end;
.col-#{$i}-#{$end} {
width: ($i*$single--column) + (($i - 1)*$gutterSize);
@if $i == $end {
float: none;
} @else {
margin-right: $gutterSize;
float: left;
&:last-child { margin-right: 0; }
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment