Last active
January 1, 2017 12:52
-
-
Save vrcosta/32019f43eb047d12d7e5e9031be5eae6 to your computer and use it in GitHub Desktop.
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
window.addEventListener('devicelight', function(e) { | |
var html = document.querySelector('html'); | |
if (e.value < 100) { | |
html.classList.remove('light'); | |
html.classList.add('dark'); | |
} else { | |
html.classList.remove('dark'); | |
html.classList.add('light'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment