Remember this rule of thumb: "What you can do with CSS (CSS1 and CSSP), do with CSS. What you can't do with CSS, do with JS."
In other words: if the value is static and never need change, set it from CSS. If the value is conditional or needs to be set dynamically, set it from JS.