That's OK, my solution for you doesn't require you to know C, but it uses the macro facility of the C preprocessor.
This is easy, btw... Here's how:
I'll use a simple example css file (test.css) with only four lines in it:
Code:a:link {color:#2f78c0;} a:visited {color:#2f78c0;} a:hover {color:#2fc0c0;} a:active {color:#2fc0c0;}
Notice how in this contrived example, we want to use the same colour a couple of times. In fact, we want to do this for a couple of colours.
OK, rename the file to test.cssp (or something).
Modify it as so:
Code:#define LINK_COLOUR 2f78c0 #define HOVER_COLOUR 2fc0c0 a:link {color:#LINK_COLOUR;} a:visited {color:#LINK_COLOUR;} a:hover {color:#HOVER_COLOUR;} a:active {color:#HOVER_COLOUR;}
See what we've done? We've defined macros that the C preprocessor will expand.
Use this command line:
gcc -E -x c -P test.cssp > test.css
This will expand the macros and create a file called test.css for you, with your colour values inserted in the right place.
Let me know if you need more info.
I really think you're using a sledgehammer to fix a problem.
Although your example is simplified in CSS you can group multiple items together:
a:link, a:visted {color:#2f78c0;}
a:hover, a:active {color:#2fc0c0;}
there, each color used once. same effect, except to test your site you don't need to run a make step.