I’ve put together a script that converts CSS to JSON and back to CSS. I’ll be using it to build a Theme Editor in Crayon.
// To JSON, ignoring order of comments etc
var json = CSSJSON.toJSON(cssString);

// To JSON, keeping order of comments etc
var json = CSSJSON.toJSON(cssString, true);
	
// To CSS
var css = CSSJSON.toCSS(jsonObject);
The sample.html file that demonstrates the script, along with the script itself, can be found on GitHub: https://github.com/aramkocharyan/CSSJSON