Many users have pointed out that achieving this in pure HTML, JS or CSS is not possible unless you pass all content through a CGI/PHP/ASP script - which actually isn't a bad idea as it makes maintenance easier.
One workaround is to use a query string in the file references for CSS / JS files - for example, '/css/stylesheet.php?timestamp=2010-01-01+00:00:00'. This will allow most clients to cache your CSS/JS files aggressively, minimizing any impact on loading times from parsing them in a scripting language (unless the site is expected to have high traffic).
If you are using Apache (which is common), another option is to utilize something like mod_set to dynamically rewrite all HTML, JS and CSS files. However, this may be more challenging to maintain if you are unfamiliar with configuring Apache (or using a different web server).
When it comes to naming tags:
In either scenario, it is highly recommended to implement a clear tagging system for dynamic variables (e.g. %MyBlue%) and consider using descriptive variable names (e.g. %HeadingBackgroundColor%, %FontColor%) even if they both refer to the same color (%MyBlue%). This approach prevents confusion in the future when making changes to values.
While using more verbose names might seem excessive initially, it helps avoid conflicts where colors clash unintentionally due to significant differences from the original scheme. Many mainstream software applications with skinning capabilities face this issue because of assumptions made about how certain values should interact, limiting the customization options due to unintended dependencies.