I personally don't have a need for dynamic variables but I can see how it could be useful. I just never understand why JavaScript is not an option
why javascript …
- JavaScript is widely available
- Most people don't disable it
- JavaScript is cached by browser
- You can test and run locally
- I am sure there are more?
examples …
Enough talk, I did two quick examples ... these are files are identical except they set different variables for colors and size:
white background »
orange background »
how …
I am not going to give a tutorial on JavaScript ... but just want to show the basic concept...
//variable in css
background-color: DVCJ_BGCOLOR;
//javascript setting
DVCJ_BGCOLOR = '#fff';
//replacement
dvjc_css = dvjc_css.replace(/DVCJ_BGCOLOR/g, DVCJ_BGCOLOR);
//write css
document.write('<style>'+ dvjc_css +'</style>');