Post by: Jeff Lim
Posted on: 11/29/2016 9:02:00 PM
Categories: SharePoint;Office 365
Description: Troubleshooting issues when using "Change the look" in SharePoint 2013.
When deploying a themed CSS in SharePoint 2013, there are a lot of guides out there explaining the process. The best one I found is this article from Microsoft MSDN here. Recently when testing a deployment for a large client, I ran into issues where a CSS file was not getting themed by the server-side theming engine. Even after repeated attempts to kick off the engine by going to Site Settings > Change the look, my CSS was still not getting incorporated with the annotated comments. Here is my troubleshooting process and how I resolved it. Scenario You want to customize colors on elements in your SharePoint site. You have a custom masterpage, some themable CSS files with annotations (e.g. h1 /* [ReplaceColor(themeColor"ContentAccent1")] */color#000000; ), and also some .spcolor files. Ensure that you have all the publishing features turned on. Alternatively, create a new site collection using the Publishing Portal site collection template. Put all themeable CSS in the /Style Library/Themable or /Style Library/[locale, e.g. en-us]/Themable folder. All themable CSS files must be checked in. In your custom masterpage, ensure that there is a tag pointing to the CSS file e.g. <SharePointCssRegistration Name="<%$SPUrl~SiteCollection/Style Library/Themable/MyCustomFile.css%>" runat="server" /> Your custom masterpage in the masterpage gallary must be checked in and published. Your .spcolor files must be uploaded and checked in at Site Settings > Themes > 15. Go to Site Settings > Change the look. Apply the new look with the custom masterpage and choose the color scheme corresponding to the .spcolor file. Try it out then accept it. Wait for the site to process the new look. Immediately go to Site Settings > Themes, then open the folder named Themed. There must be a new folder created here (e.g. 1234CDEF or some combination of 8 hexadecimal characters). If there is no new folder, then at least the files in one of the existing folders must have some updated files. If your CSS is themed properly, the SharePoint theming engine will put together all the styles into files with extension .themedcss, and your site page source will have references to files in this folder. If you don't see a new folder in Site Settings > Themes > Themed, or you don't see any updated files here, then there is a 99% chance that the theming engine failed without informing you! Proceed to the next steps. Revert back to the default masterpage and colors in Change the look. Delete all folders in Site Settings > Themes > Themed. Go to Site Settings > Themes > 15. Rename your .spcolor file (I recommend something starting with an A or number so that it appears right at the top when selecting a color in the Change the look menu). Note that deleting and reuploading doesn't seem to work. Try to change the look again and choose the scheme matching the renamed .spcolor file. Apply the look and review step 8.Leave a comment below if you still have issues compiling your new look!