In JavaScript we can create element dynamically and append to section in order to apply CSS rule for huge number of elem
There's a library called less.js which lets you manipulate css with variables in in your.css file.It's a very good library and you might want to take a look into that. http://www.lesscss.org/