It might depend on "why" you want to use variables.
If you just want a way to be able to edit many identical values throughout the stylesheet by changing a single variable definition, then that approach should be fine.
If it's because you want something dynamic that can change often (perhaps by user inputs), then you may have a bit of a problem with caching, resulting in the use of older values. This could be avoided by sending nocache headers with the stylesheet file, but then that sort of defeats the purpose of having a separate CSS file.
However, if you combine it with URL query string variables, then any change to those variables will be interpreted as a different file by the browser, thus avoiding caching issues.
Main file:
<link rel='stylesheet' type='text/css' href='/style.php?color=2' />
style.php:
<?php
header('Content-Type: text/css');
$color = (!empty($_GET['color']) ? (int) $_GET['color'] : 0;
switch($color)
{
case 1:
$b1 = '#ffffff';
$c1 = '#000000';
break;
case 2:
$b1 = '#000000';
$c1 = '#ffffff';
default:
$b1 = '#ddeeff';
$c1 = 'navy';
}
?>
body {
margin: 0;
padding: 1em 2em;
background: <?php echo $b1; ?>;
color: <?php echo $c1; ?>;
}