Skip to content

Instantly share code, notes, and snippets.

@laurenclark
Created October 21, 2014 12:20
Show Gist options
  • Save laurenclark/ab20e14266b8aa8e56d7 to your computer and use it in GitHub Desktop.
Save laurenclark/ab20e14266b8aa8e56d7 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.6)
// Compass (v1.0.1)
// ----
@function grid-width($count, $gutter, $width){
$grid-width: ($count - 1) * $gutter + ($count * $width);
@return $grid-width;
}
@function context-width($context, $width, $gutter) {
$context-width: $context * ($width + $gutter);
@return $context-width;
}
@mixin the-grid($count, $context: 12, $width: 60, $gutter: 20) {
$grid-width:grid-width($count, $gutter, $width);
$context-width:context-width($context, $width, $gutter);
width: percentage($grid-width / $context-width);
}
.block {
@include the-grid(6);
}
.block {
width: 47.91667%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment