I’ve been dabbing with random and customised settings for my blog (which I use mainly for testing things out) and after putting a random Header JPG graphic I decided I didn’t like the default color scheme when shown with half the pictures I put there.
I was looking around for the best way to set-up a dynamic CSS chooser for when a picture is chosen. Currently a PHP script chooses the random picture for the header and modifies the header div style information, so the variable is there. Theoretically I could pick a CSS based on that variable that contained the correct color scheme for the chosen picture (only the color scheme would change, not the layout or anything).
Can you guys give some ideas on the best way to do this? I’d like to be able to pick a random image and a CSS to match it (I’d probably just select a number at random and have the template pick $var.jpg and $var.css but I wanted to know alternatives).
Also, has anyone investigated on creating dynamic CSS stylesheets instead of doing fixed ones? I’d rather create a template CSS file and have the variables in it changed than creating 30 different CSS files.
- The topic ‘Dynamic CSS selection’ is closed to new replies.