CSS is for styling and layout, but there is no conceptual reason this couldn’t be defined through functions.
“Code” is not a concern like semantic vs style.