-
-
Save billerickson/8ac6c0aeda0d72edf676 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
/** | |
* Grid Overlay | |
* @link http://www.billerickson.net/overlay-css-grid | |
*/ | |
function be_grid_overlay() { | |
if( ! isset( $_GET['grid'] ) || 'true' !== $_GET['grid'] ) | |
return; | |
$columns = 16; | |
echo '<div class="grid-overlay"><div class="wrap"><div class="gutter"></div>'; | |
for( $i = 0; $i < $columns; $i++ ) { | |
echo '<div class="col"></div><div class="gutter"></div>'; | |
} | |
echo '</div></div>'; | |
} | |
add_action( 'wp_footer', 'be_grid_overlay' ); |
This file contains 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
/* Grid | |
---------------------------------------------------------------------------------------------------- */ | |
/* 1) Set grid max width */ | |
.grid-overlay .wrap { | |
max-width: 1380px; | |
} | |
/* 2) Set size of column and gutter */ | |
.grid-overlay .gutter { | |
width: 1.449275362%; /* 20/1380 */ | |
} | |
.grid-overlay .col { | |
width: 4.710144928%; /* 65/1380 */ | |
} | |
/* Additional Styles */ | |
.grid-overlay { | |
position: fixed; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
z-index: 999; | |
} | |
.grid-overlay .wrap { | |
margin: 0 auto; | |
border-right: 1px solid #f00; | |
padding: 0; | |
} | |
.grid-overlay .wrap > div { | |
border-left: 1px solid #f00; | |
height: 100vh; | |
float: left; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.grid-overlay { pointer-events: none; }
This will enable you to click through the overlay