I'm currently able to dynamically change style rules directly via JS, but I find this rther limiting and I'd rather be able to to hot-swap entire CSS stylesheet files. Any suggestions?
My code:
<label>Themes :</label>
<select name="background" id="bg" onchange="changeBg(this)">
<option value="white">Default</option>
<option value="#444">Dark</option>
<option value="teal">Teal</option>
</select>
// Changing Themes
function changeBg(x){
var body = document.getElementById('body');
body.style.backgroundColor = x.value;
}
And perhaps I'd have multiple stylesheet definitions, like so:
<!-- Themes -->
<link type="text/css" rel="stylesheet" media="all" href="style.css" id="theme1_css">
<link type="text/css" rel="stylesheet" media="all" href="themes/dark.css" id="theme2_css">
<link type="text/css" rel="stylesheet" media="all" href="themes/teal.css" id="theme3_css">