I just finished coding a PHP based helpdesk app, and I find out one of the users is color blind. I figure, no prob, I'll just give him a way to set his own preferences. Of course, I'm using CSS.
Giving the user a form with choices and writing it all out to a css file is no problem, but what I want to do is first read in an existing css doc, which is formatted like this:
BODY {
border: 2;
background: #dddddd;
font: verdana, Arial, Helvetica;
font-size: 8pt;
color: black;
}
A:LINK {
font-family: verdana, Arial, Helvetica;
font-size: 8pt;
color: darkblue;
text-decoration: none;
}
...
By reading it in, the user never has to completely start over.
Is the best way to handle this with arrays, evaluating each element as the page is rendered? For instance:
$style["body"]["border"] = "2";
$style["body"]["background"] = "#dddddd";
...
or is there a more elegant, more sensible way of doing this?
need help getting started parsing css data
Moderator: General Moderators
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
I need to protect my poor users from the code
I have decided to do this using arrays. If anyone wants what I come up with, send me your email and I'll send you the finished code.