Last active
March 15, 2018 18:44
-
-
Save jmuspratt/f2ffda005cf7892ccf23649b78b80f78 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
// Wordpress Admin bar breakpoints | |
$bp--admin-bar-sticks: 600px; | |
$bp--admin-bar-gets-taller: 783px; | |
// Wordpress Admin bar heights | |
$wp-narrow-offset: 46px; | |
$wp-wide-offset: 32px; | |
// Fixed-positioning that accounts for WP admin bar when present | |
@mixin admin-bar-fixed( $offset: 0 ) { | |
$narrow-offset: $wp-narrow-offset + $offset; | |
$wide-offset: $wp-wide-offset + $offset; | |
// without admin bar present, just use the passed value | |
top: $offset; | |
.admin-bar & { | |
top: $narrow-offset; | |
@media screen and (min-width: $bp--admin-bar-gets-taller) { | |
top: $wide-offset; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment