Skip to content

Instantly share code, notes, and snippets.

@babsgosgens
Last active December 20, 2015 21:49
Show Gist options
  • Save babsgosgens/6200104 to your computer and use it in GitHub Desktop.
Save babsgosgens/6200104 to your computer and use it in GitHub Desktop.
// Roll out the required columns
@each $fraction in $column-widths {
$name: fraction-to-text($fraction);
@if $name {
.#{$name} {
@include column-width($fraction);
}
.#{$name}.persistent {
@include column-width($fraction, true);
}
// Source Ordering
.push-#{$name} {
@include move($fraction);
}
// Source Ordering
.pull-#{$name} {
@include move(-1*$fraction);
}
}
}
// Outputs:
.half { width: 50%; }
.half.persistent { width: 50% !important; }
.push-half { position: relative; left: 50%; }
.pull-half { position: relative; left: -50%; }
.fourth { width: 25%; }
.fourth.persistent { width: 25% !important; }
.push-fourth { position: relative; left: 25%; }
.pull-fourth { position: relative; left: -25%; }
.third { width: 33.33333%; }
.third.persistent { width: 33.33333% !important; }
.push-third { position: relative; left: 33.33333%; }
.pull-third { position: relative; left: -33.33333%; }
.two-third { width: 66.66667%; }
.two-third.persistent { width: 66.66667% !important; }
.push-two-third { position: relative; left: 66.66667%; }
.pull-two-third { position: relative; left: -66.66667%; }
.three-fourth { width: 75%; }
.three-fourth.persistent { width: 75% !important; }
.push-three-fourth { position: relative; left: 75%; }
.pull-three-fourth { position: relative; left: -75%; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment