Not sure about that, never had to change CSS dynamically like that. I could imagine you'd either send the file green-theme.css or blue-theme.css, but not switch it with AJAX or even WebSockets. By the way, when you use a preprocessor like LESS, SASS, or SCSS you can use a variable.
// green-theme.scss
$primary-color: green;
// blue-theme.scss
$primary-color: blue;
// theme.scss
.node {
background-color: $primary-color;
}
Now you only have to switch or overwrite some variables instead of writing your complete theme twice :D See also my reply to Marc Clifton below.
Best, Sander Continuous Integration, Delivery, and Deployment arrgh.js - Bringing LINQ to JavaScript Object-Oriented Programming in C# Succinctly