github-dark-theme
github-dark-theme copied to clipboard
mouseleave event
Please consider adding this code to the content script. I was going to do a PR, but when I build the manifest does not have the content script and I'm not sure how to change that part. When the mouse leaves the highlighted row, the highlight will go away. With the default GitHub color scheme, I did not notice the highlighted color so it was never an issue. With the dark mode, it stands out a lot imho. Thanks for considering.
docReady(function(){
var userSelection = document.getElementsByClassName('js-navigation-item');
for(let i = 0; i < userSelection.length; i++) {
userSelection[i].addEventListener('mouseleave', function() {
this.classList.remove('navigation-focus');
})
}
});
function docReady(fn) {
if (document.readyState === 'complete' || document.readyState === 'interactive') {
setTimeout(fn, 1);
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
I see now if you navigate via page buttons then the event listeners are not added.