I was wondering if it was possible to define something eg a color with (in C) #define Brown #804040 and then use the term "Brown" eveywhere I wanted to have #804040, in the CSS file. This would make it easier to change colours on a global scale with just one edit, rather than looking for all instances of the colour.
I am new to CSS so excuse the lame questions. Thanks.
Hello heini, The advantage is that I would not have to do a global replace. I would only have to change it once - at the (eg #define Brown #804040 to #define Brown #CCCfff) and all instances where "Brown" occurs would change automatically and now be #CCCfff instead of #804040
This method is used in many languages (C pascal etc ) at the top of the file you have stuff like #define Brown #804040 #define MyEmail billG@microsoft.com
These may occur many times within the file. The advantage of a macro is that I do not have to find them, just change the definition at the top of the file (or included file) and the preprocessor or compiler does the rest for me. It is neat & tidy.
I am not sure yet how sophisticated this CSS stuff is, I used to be a C,C++ programmer and old habits die hard.
I will probably just move all things that I might want to change from time to time (like aesthetics) to a separate file like color.css and have the definitions there. At least they will be in one place.
To my mind this is a bit too clunky to use effectively so I can't really recommend it - but if you are already using a php stylesheet for other reasons (e.g. browser switching) then it might be useful to you.