View Single Post
Old 07-04-2008, 01:11 PM  
harvey
Confirmed User
 
harvey's Avatar
 
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
I'm not sure what do you exactly need, but if I'm getting you right, of course you can, and it's quite easy, check http://interfacelab.com/variables-in-css-via-php/

in action (from http://sperling.com/examples/pcss/ )

in action (from http://sperling.com/examples/pcss/)

Code:
<?php
header("Content-type: text/css");
$color = "green";        // <--- define the variable 
echo <<<CSS   
/* --- start of css --- */
h2
	{
	color: $color;  /* <--- use the variable */
	font-weight: bold;
	font-size: 1.2em;
	text-align: left;
	}
/* --- end of css --- */
CSS;
?>

I already made a few projects using this method and works like a charm, in conjunction with XSL/XML environments is a real help then again, not sure if this is what you're looking for
__________________
This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth
harvey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote