JSON stylesheets - JSSS

problems with CSS

advantages of JSON stylesheets

4 line example JSSS parser using jQuery


	function parseCSS(id,css){
	  for(style in css){
		if(typeof css[style] == 'object'){parseCSS(style,css[style]);
		else{$(id).css(style,css[style]);}
	  }
	};
	

usage


	
	var drip = {};	
	drip.toolbar = {};
	
	drip.toolbar.css = {
	  height : "40px", 
	  width : "89px", 
	  position :"fixed", 
	  right : 50, 
	  bottom : 0,
	  overflow : "hidden",
	  cursor : "pointer",
	  color : "#FEFEFE",
	  "background-color": "#932c2c",
	  "text-align" : "left",
	  "font-family" : "Arial, Helvetica, sans-serif",
	  "font-size" : "12px",
	  
	  "#drip-toolbar-button" : {
		height : "30px",
		width : "50px",
		cursor : "pointer",
	  },
	  
	  ".links" : {
		  color : "#FEFEFE"
	  }
	  
	};
		
	parseCSS('#drip-toolbar', drip.toolbar.css);