Last active
December 17, 2015 20:58
-
-
Save jordanmerrick/5670906 to your computer and use it in GitHub Desktop.
Load an alternative/additional CSS file depending on the visitor's current time.
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
<script> | |
var currentTime = new Date().getHours(); | |
if (22 <= currentTime&¤tTime < 24 || 0 <= currentTime&¤tTime < 6) { | |
document.write("<link rel='stylesheet' href='{{ SITEURL }}/theme/css/night.css' type='text/css'>"); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment