Issue


You have noticed that some colors on your Modern Communication and Teams site pages revert to the default SharePoint theme color:



Colors from Theme Builder Color Palette:


Refreshing the page sometimes fixes the issue.


Reason


Due to recent update from Microsoft side, SharePoint is now applying the default out-of-the-box color theme on some Communication and Teams sites instead of theme colors selected by user.


Solution


This issue will be fixed in Silent Upgrade ShortPoint release, planned for October 2020.


Until then, you may use the workaround described below, or download and upgrade to the hotfix ShortPoint release that already includes the fix of this issue:

  1. Download the hotfix package
  2. After you downloaded the package, please upgrade to it:

Workaround


You may fix this issue and bring the colors back by adding custom JavaScript code in Theme Builder.


Important: The following workaround will not fix the colors on the system pages (e.g., Site contents, Site pages, Documents etc.). We are planning to fix this issue in our upcoming release.

Step 1. Open Custom JavaScript section in ShortPoint Theme Builder


Open Theme Builder (Site contents > ShortPoint Dashboard > Theme Builder > Customize my site).


Navigate to Utilities Custom JavaScript:



Step 2: Add the fix code


Add the following code in the text box:


(function() {
  shortpoint.core.util.spfx.getAppliedTheme().then(function(response) {
    var themeData = JSON.parse(response.d.GetContextWebThemeData);
    var theming = shortpoint.branding.util.spfx.theming;
    var theme = theming.convertOldThemeStructureToSpfx(themeData);
    theming.spfxHelpers.loadTheme(theme);
  });
}())



Press Apply and Publish. 



That's it, the colors should now be the ones as you have in your chosen theme.



Note: if the changes do not reflect immediately, try re-entering the theme colors (Theme Builder > Branding > Color Palette) and publishing them again.



Related articles: