css and dynamic(ish) colours
-
Style sheets have hash colour values all through them, often with a single colour being used repeatedly. Is there a way in CSS to define a set of custom colours at the top of the sheet, and have these propagate down the sheet?
eg, define:
lite1:#FFFFFF
lite2:#DDDDDD
lite3:#AAAAAA
dark1:#000000
dark2:#333333
dark3:#555555and then just use these values all through the sheet:
text-color:dark1;
border:solid 1xp lite3;
and so on, this way you only have to change the values ONCE in the sheet instead of copying and replacing them throughout the entire sheet.I know this isn’t dynamic in that the colour values are selected from an external source, maybe that can be my next question. For now, I’d be happy to know how I can make this work
addendum: I once ran my own web server and I setup css to be process by the php engine and I constructed the css in php so that I could do this. Unfortunately there is an overhead doing this. This was some years ago and I’m wondering if CSS has moved forward in some way in this area.
- The topic ‘css and dynamic(ish) colours’ is closed to new replies.