im start work on a new LAMP project.
in general, all the css classes that I do, especially for the layout, look like this:
.pageBoundaries{
width:999px;
margin:auto;
}
.onethird{
width:333px;
float:left;
display:block;
}
.twothird{
width:666px;
float:left;
display:block;
}
.half{
width:499px;
float:left;
display:block;
}
Now I thought that I was making a php file to manage things like width (maybe color, borders, etc.). as:
$pageWidth=999;
.pageBoundaries{
width:<?php $pageWidth ?>px;
margin:auto;
}
.onethird{
width:<?php $pageWidth/3 ?>px;
float:left;
display:block;
}
.twothird{
width:<?php ($pageWidth*2)/3 ?>px;
float:left;
display:block;
}
.half{
width:<?php $pageWidth/2 ?>px;
float:left;
display:block;
}
and then I can set the headers from this php file so that the browser interprets it as a css file. any ideas on this scheme? its pros and cons?
By doing this, I think creating colorful themes would also be pretty easy.
source
share