Is it possible to create a css class based on a javascript object or variable?
An example would be if you had an input where you can enter a hex code. I can extract the value using javascript and set it to a var.
I can then use this var to set inline styles with javascript thus changing the color of text on the page. However is there a way I could use this var and create a css class? Rather than go through all the elements of the page and set the color, I'd rather add a class on one element of the page that then have the styles nested within that class to cascade to other elements.