Last active
August 29, 2015 14:19
-
-
Save ravenwilde/fdc58da9200a743b648f to your computer and use it in GitHub Desktop.
Grid Overlay for Testing Vertical Rhythm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For Testing | |
// Vertical rhythm grid | |
// Based on the Bourbon/Neat Column Grid Mixin | |
$vertical-grid: no !global; | |
$vertical-grid-color: #444444 !global; | |
$vertical-grid-index: front !global; | |
$vertical-grid-height: (1em * 1.5); | |
$vertical-grid-opacity: 0.3 !global; | |
@mixin grid-vertical-rhythm($grid-height) { | |
$transparent: rgba(0,0,0,0); | |
$color: $vertical-grid-color; | |
$repeat: $grid-height * 2; | |
background-image: -webkit-repeating-linear-gradient(to bottom, $transparent, $transparent $grid-height, $color $grid-height, $color $repeat); | |
background-image: -moz-repeating-linear-gradient(to bottom, $transparent, $transparent $grid-height, $color $grid-height, $color $repeat); | |
background-image: -ms-repeating-linear-gradient(to bottom, $transparent, $transparent $grid-height, $color $grid-height, $color $repeat); | |
background-image: -o-repeating-linear-gradient(to bottom, $transparent, $transparent $grid-height, $color $grid-height, $color $repeat); | |
background-image: repeating-linear-gradient(to bottom, $transparent, $transparent $grid-height, $color $grid-height, $color $repeat); | |
} | |
@if $vertical-grid == true or $vertical-grid == yes { | |
body:before { | |
content: ''; | |
display: inline-block; | |
@include grid-vertical-rhythm($vertical-grid-height); | |
height: 100%; | |
left: 0; | |
margin: 0 auto; | |
opacity: $vertical-grid-opacity; | |
position: fixed; | |
right: 0; | |
width: 100%; | |
pointer-events: none; | |
@if $vertical-grid-index == back { | |
z-index: -1; | |
} | |
@else if $vertical-grid-index == front { | |
z-index: 9999; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment