Skip to content

Instantly share code, notes, and snippets.

@daneden
Created July 18, 2014 17:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save daneden/ec73794e23abc9ccb284 to your computer and use it in GitHub Desktop.
Save daneden/ec73794e23abc9ccb284 to your computer and use it in GitHub Desktop.
// Involves some hacky manually-coded pixel values, but a lifesaver for debugging grids
@if $debug {
.debug--cols {
@each $group in $col-groups {
.grid--debug-#{$group}-cols:before {
content: '';
position: absolute;
margin: 0 auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
$cols: $group;
$output: ();
@for $i from 1 to $cols {
$output: append($output, #{"#{transparentize($blue, .95)} #{percentage($i/$cols)},"});
$output: append($output, #{"transparent #{percentage($i/$cols)},"});
$output: append($output, #{"transparent calc( #{percentage($i/$cols)} + 30px ),"});
$output: append($output, #{"#{transparentize($blue, .95)} calc( #{percentage($i/$cols)} + 30px ),"});
}
background-image: linear-gradient(left,
transparent,
transparent 30px,
transparentize($blue, .95) 30px,
unquote($output)
transparentize($blue, .95) 100%
);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment