10 May 2005

PHP

“One reason for this explosive growth is that PHP is free and open source. It’s also a relatively easy language to learn and the de facto standard for developers creating dynamic Web pages. But it is also perfectly suited for deploying CSS and many other Web technologies.”

Generating Dynamic CSS with PHP
One of the things I’ve done with the new yummy wakame (I know I know, it will be launched eventually!) is used PHP in my main stylesheet. This is because each section has identical styles, but a different colourscheme. So at the top of each page (in a section server side include) I declare new values for the colour variables that page will use, and the stylesheet looks for these values when it’s loaded, filling in the colours where Ive put placeholders. This way I can avoid creating separate stylesheets for each section, keeping the site size down to a minimum, and eliminating the need to make changes across a whole bunch of stylesheets every time I make a small change.

Anyway, I found this article today which explains how it’s done. I wish I’d found it before when I originally got the idea months back. This one does it in a different way though… but it works just as well.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.