But what about not putting the CSS directly in a .css file, but output it from a .php file instead, just like we generate HTML in .php files rather than storing it directly in .html ?
This allows for all kinds of cool constructions.
For example, suppose some .html contains:
Code: Select all
<link href="DynamicStyleSheet.php" rel="stylesheet" type="text/css">Code: Select all
<?php
$size = 600;
$sizeLeft = intval($size/3);
$sizeRight = $size - $sizeLeft;
print(".column1 { width: $sizeLeft px; }");
print(".column2 { width: $sizeRight px; }");
?>Do you people ever use .php files like this to dynamically generate CSS content?