What are the potential benefits and drawbacks of using PHP to generate CSS for website styling?

Using PHP to generate CSS for website styling can offer the benefit of dynamic styling based on user input or database values. It can also simplify maintenance by centralizing style configurations. However, it may introduce complexity and decrease performance due to the need for server-side processing for each page load.

<?php
header("Content-type: text/css");

$primaryColor = "#ff0000";
$secondaryColor = "#00ff00";

?>

body {
    background-color: <?php echo $primaryColor; ?>;
}

h1 {
    color: <?php echo $secondaryColor; ?>;
}