Skip to content

Instantly share code, notes, and snippets.

@JoseSoteloCohen
Last active August 15, 2019 02:28
Show Gist options
  • Save JoseSoteloCohen/28f217947ac187a7d811755efa971f66 to your computer and use it in GitHub Desktop.
Save JoseSoteloCohen/28f217947ac187a7d811755efa971f66 to your computer and use it in GitHub Desktop.
Blackout Fix: for Authority Pro 1.2.0 child theme for the Genesis Framework 3.0.2
<script>
var $=jQuery.noConflict();
var blackoutFix = $('<style id="blackoutFix">.ab-block-post-grid-image a::before, .authority-featured-image::before, .featuredpost .has-post-thumbnail > a::before { display:none; }</style>');
function darkmode_fix(){
$('.darkmode-toggle').click(
function() {
if ($('body').hasClass('darkmode--activated')) {
$('head').append(blackoutFix);
$('body > div.site-container > div.site-inner > div.authority-featured-image').css('z-index', '501');
$('.ab-block-post-grid a').css('z-index', '501');
$('#search-2').css('margin-top', '0px');
}else{
$('#blackoutFix').remove();
$('body > div.site-container > div.site-inner > div.authority-featured-image').css('z-index', '-1');
$('.ab-block-post-grid a').css('z-index', '0');
$('#search-2').css('margin-top', '-60px');
}
}
);
}
jQuery(document).ready(function($){
darkmode_fix();
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment