Skip to content

Instantly share code, notes, and snippets.

@fabien-d
Created October 15, 2013 13:18
Show Gist options
  • Save fabien-d/6991426 to your computer and use it in GitHub Desktop.
Save fabien-d/6991426 to your computer and use it in GitHub Desktop.
SASS mixin for vertical alignment debugging
/**
* Inspired from http://basehold.it
*
* Should only be used for debugging vertical alignment and on <body> tag.
*
* @example
* body.debug {
* @include debugVAlignment();
* }
*/
@mixin debugVAlignment ( $lineheight: 24px, $colour: rgba( 255, 0, 0, .4 ) ) {
position: relative;
&:after {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: auto;
height: auto;
z-index: 9999;
pointer-events: none;
background-image: linear-gradient( $colour 1px, transparent 1px );
background-size: $lineheight $lineheight;
}
// hide on mousedown
&:active:after {
display: none;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment