Hassan Schroeder wrote:
> Terrence Wood wrote:
> 
> 
>>Constants and variables are not going to part of CSS any time soon, so you
>>will need some kind of server side solution ...
>>
>>AFAIK they all use seom form of regex to do the replacement
> 
> 
> Well, no -- I frequently use variables in style sheets built in JSP,
> especially early on in development. And there it's simple Expression
> Language (EL) variable substitution, so something like this:
> 
> a:hover, a:focus { color: ${contrastColor}; }
> 
> can be evaluated per site, per session, or even per request, making
> it really easy to test, tune, and/or customize...
> 
> FWIW!

You can also do almost the same thing with PHP just do the following:

<?php

$variable="do your declarations here";
$bg="#fff"
$h1=100;
$w1="20em";
header('Content-Type: text/css');
echo "

html{
    color:#123;
    background:$bg;
}

#header{
    height:{$h1}px;
    width:$w1;
}
";
?>

note that it's important that there are double quotes on the echo and
not single.
******************************************************
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
******************************************************

Reply via email to