Quote:
Originally Posted by karinne
|
That's actually what I used first for my site.
Later on, however, when I needed more style switching, I found their approach a little heavy-handed. Instead of specifying
alternate stylesheets, I just added all the stylesheets by default, then disabled them with javascript
:
- Code: Select all
document.getElementById("myStyleSheet").disabled=true
This helped me to manage
eight "alternate" stylesheets modularly, with relatively little javascript.
Then you can enable them as required:
- Code: Select all
document.getElementById("myStyleSheet").disabled=false
The disadvantage is that these will no longer be identified as
alternate stylesheets by the browser, so you won't be able to switch them using the browser.
Of course, you still have to track the styles with cookies.
To make it degrade gracefully when javascript is off, I added a final stylesheet (the last one takes precedence, all other things being equal), which resets all the styles to default.