Skip to content

Instantly share code, notes, and snippets.

@johnduhart
Created October 10, 2009 19:02
Show Gist options
  • Save johnduhart/207052 to your computer and use it in GitHub Desktop.
Save johnduhart/207052 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Gunski demo</title>
<link rel="stylesheet" href="style.php" type="text/css" />
</head>
<body>
<h1>Note the changing background</h1>
<p>compwhizii, 2009</p>
</body>
</html>
/* The following CSS is static, pulled from style.css */
h1 {
font-size: 12px;
}
<?php
$css = file_get_contents("style.css");
$colors = array("#FFFFFF", "#AAAAAA", "#b4b4b4", "#a9a9a9");
$css .= "/* The following CSS is dynamic */\n\n";
$css .= "body { background: ".($colors[rand(0,3)])."; }\n";
echo $css;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment