Skip to content

Instantly share code, notes, and snippets.

@bogdansoare
Forked from daneden/grid.debug.scss
Created July 19, 2014 10:20
Show Gist options
  • Save bogdansoare/c6d4d1887b1e6a0a99eb to your computer and use it in GitHub Desktop.
Save bogdansoare/c6d4d1887b1e6a0a99eb 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