If I write code in PHP, is there a reason why I would use a CSS preprocessor instead of PHP? For example, I could use PHP in my CSS file, having this in my header:
<link rel="stylesheet" type="text/css" media="all" href="style.php" />
That way I could pass variables like style.php?color=#000
Or I could use something like LESS to preprocess my CSS. If I use less.js, I'm not sure how I can pass variables, as in the previous example.
Now I heard that PHP CSS files cannot be cached, so I can understand why this was a problem, especially if the CSS file was large. But I would like to pass the variables to my CSS sheet.
Can someone tell me a little more about why I will use one above the other, and / or how to pass variables to my .less file if I used less.js?
source
share