I have been looking, but cannot find out how ReplaceColor works in the css and with the Site Settings Themes area that some users can see?

/* [ReplaceColor(themeColor:"Dark2")] */ color:#666666;

Is it a CSS hook of somesort for DARK2 in the themes area?

2 Answers 2


SharePoint 2010 (not certain if 2007 has) has new feature named theamable css. This are normal css files, that usually should be placed under 14\TEMPLATE\LAYOUTS\1033\STYLES\Themable\. The only difference is magic /* [ReplaceColor(themeColor:"Dark2")] */ lines. If you go to site theme settings, you can see this settings: enter image description here
So, what does actually this line mean: /* [ReplaceColor(themeColor:"Dark2")] */ color:#666666;?

It means, that if you apply theme to your site, your color (#666666) will be dynamically replaced with color, which is currently selected under Dark 2 in particular theme(see screenshot above).

How does it internally work? Every time when you select a theme for site (theme is a .thmx file actually), sharepoint dynamically open .thmx, extracts color and fonts, and then replaces all ReplaceColor-like placeholders with particular color from .thmx. All this parsed css later holds in your site under /_catalogs/theme/Themed/<theme unique id>/<css file>.css (you can verify it using sharepoint manager). When theme is applied, all css files (and even some images) references from this site folder. This is how all this magic works :).
You can also use RecolorImage feature for images, but I don't know exact understand how it works.

Additional info about themeable css: Leveraging Themable CSS


When a theme is chosen, SharePoint looks for specific CSS markup comments and the referred CSS and replaces the colors and fonts as it appears right below the comments line. ReplaceColor is one of the token Sharepoint would look for so in your case #666666 will be replaced by whatever Dark2 color you choose from in the site settings.

See if this article helps you: http://blog.sharepointbits.com/2010/01/how-themes-work-in-sharepoint-2010_04.html

  • Yes! Thanks @ashish that confirms my thought. Great article btw.
    – user6876
    Feb 11, 2012 at 20:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.