Skip to content

Instantly share code, notes, and snippets.

@conormcafee
Created September 25, 2015 16:02
Show Gist options
  • Save conormcafee/99101f6b91f1cad7b1e1 to your computer and use it in GitHub Desktop.
Save conormcafee/99101f6b91f1cad7b1e1 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$max-width: 1100px;
$margin: 15px;
$margin-p: percentage(15px / 1100px);
$grid: (
one-col: 1100px - $margin,
two-col: 550px - $margin
);
@function columns($key) {
@if map-has-key($grid, $key) {
@return map-get($grid, $key);
}
}
@function calc-em($target-px, $context) {
@return ($target-px / $context) * 1em;
}
@mixin grid($args1, $args2) {
width: percentage(columns($args1) / $max-width);
margin-right: $args2;
}
div {
@include grid(one-col, 15px);
}
div {
width: 98.63636%;
margin-right: 15px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment