David
15th May 2007, 12:17 pm
I'm currently working on this new site and one of the primary characteristics of it is that each page has a different colour scheme. Ordinarily, this would require a different CSS file for each page but I didn't want to do that. I wondered whether it was possible to use PHP variables within the CSS file so that one style file could be used for all pages (thus maintaining consistency of layout etc.). Well, it seems it can. I found 2 excellent articles on the topic. Take a look at these:
http://www.barelyfitz.com/projects/csscolor/
http://www.shapeshed.com/journal/managing_colour_schemes_in_css/
I particularly like the first method as it doesn't rely on having to modify .htaccess and is, therefore, more portable.
http://www.barelyfitz.com/projects/csscolor/
http://www.shapeshed.com/journal/managing_colour_schemes_in_css/
I particularly like the first method as it doesn't rely on having to modify .htaccess and is, therefore, more portable.