CSS actually does have functions. ‘linear-gradient()’ is one that returns a background image. You also have the choice of interacting with your style sheets via the css object model similar to the way you interact with the DOM, this is the basis of most css in js tech.
If you can’t tell, I’m a CSS shill.