PHP'd CSS; seperating the styles wasn't the end of the world

& Server scripting languages such as PHP gives powerful tools for designers. for example, you can color specific objects on the screen, based on their content. The concept of CSS – having the styles in a separate file from the content cause a bit of a dilemma, since the styling rules are no longer immediate – rather than, set in advance to a fixed content.

But actually, this is a narrow-minded vision, since you can define which styling-rules you wish to use, based on the content. This new middle-man can actually gives the designer new power and tools. The first idea is to choose which CSS file to load based on the content. For example, the code <link rel="stylesheet" type="text/css" href="<?=timeOfDay?>_style.css"> will simply allow us to choose between several CSS, for each hour of the day, giving our site a dynamic and refreshing look.

We can even take it one step forward and linking to PHP’d css file instead of a normal CSS. The new file will undergo PHP interpretation that will produce a standard CSS, but more accurate for a specific user, time, or task. The options are once again, limitless.

© 2007. All rights reserved.