Created
March 16, 2011 19:56
-
-
Save nathansmith/873190 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
<!-- | |
A quick fix for my friend Chris Bowler. | |
http://chrisbowler.com/journal/alternate-css-files | |
--> | |
<link rel="stylesheet" media="screen" id="time_style" href="/-/css/day.css" /> | |
<script> | |
(function() { | |
var currentTime = new Date().getHours(); | |
if (currentTime < 7 || currentTime > 20) { | |
document.getElementById('time_style').href = '/-/css/night.css'; | |
} | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This way, there's at least a default present, and you override it only if it's night time :)