0

Add New Theme in Modern Site

Steps to follow change the theme in SharePoint online modern sites

Step 1:

First, make sure you have the latest version of the SharePoint Online Management Shell

Step 2:

Connect environment to power shell

 $adminUPN=”<Admin User Name>” e.g. demo@test.onmicrosoft.com 

$orgName=”<name of your Office 365 organization>” e.g. test

$userCredential = Get-Credential -UserName $adminUPN -Message “Type the password.” 

Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential

Step 3:

Run below command to check version of SharePoint management shell.

 Get-SPOHideDefaultThemes

If you do NOT get an error, but get either “true” or “false,” then you can continue. If you DO get an error, then uninstall your version of the SharePoint Online Management Shell and then download and install the latest version

Step 4:

Go to Microsoft’s online tool for generating Modern theme colors. Play with the sliders or enter in your own color codes for the primary, body, and text colors. Scroll down to the bottom part of the page to see how your color choices affect the UI elements.

selectcolor

powershellcode

Step 5:

Highlight and copy the Power Shell variables. (If you want a multi-colored theme, you won’t be able to make any additional custom changes to the colors in this interface, but you can copy the code into a text editor and make manual changes to the variables there.

Step 6:

Run PowerShell Command as below

$themepalette = @{

“themePrimary” = “#927098”;

“themeLighterAlt” = “#f7f5f8”;

“themeLighter” = “#ece5ed”;

“themeLight” = “#d0c1d3”;

“themeTertiary” = “#ae95b2”;

“themeSecondary” = “#98779d”;

“themeDarkAlt” = “#85648b”;

“themeDark” = “#5f4763”;

“themeDarker” = “#523d55”;

“neutralLighterAlt” = “#f8f8f8”;

“neutralLighter” = “#f4f4f4”;

“neutralLight” = “#eaeaea”;

“neutralQuaternaryAlt” = “#dadada”;

“neutralQuaternary” = “#d0d0d0”;

“neutralTertiaryAlt” = “#c8c8c8”;

“neutralTertiary” = “#d0c1d3”;

“neutralSecondary” = “#ae95b2”;

“neutralPrimaryAlt” = “#98779d”;

“neutralPrimary” = “#927098”;

“neutralDark” = “#5f4763”;

“black” = “#523d55”;

“white” = “#ffffff”;

“primaryBackground” = “#ffffff”;

“primaryText” = “#927098”;

“bodyBackground” = “#ffffff”;

“bodyText” = “#927098”;

“disabledBackground” = “#f4f4f4”;

“disabledText” = “#c8c8c8”;

}

Add-SPOTheme -Name “Your Theme Name” -Palette $themepalette -IsInverted $false

Step 6:

That’s it! This now adds the theme to your tenant, and you can access it from the “Change the look” panel. 

HaPpy Coding 🙂

 

Advertisements