SharePoint Online comes with a set of standard Color Themes, which you can use to change the look of your site by going to Site Settings -> Change the Look -> Themes, and choosing a new theme. The options available are shown in the screenshot to the right.
This is all well and good if you're happy with the Teal, Blue, Orange etc options that SharePoint gives you by default; however, in the real world, Marketing Departments are often quite specific around corporate branding colours that can be used
So, how do we add a corporate theme to the standard SharePoint Themes offered by Microsoft?
Well, there's currently no way to do this through the SharePoint User Interface, but the good news is a little bit of PNP PowerShell will do the trick!
So how do we do it?
STEP 1: Generate your new color scheme using an online SharePoint Theme Generator tool, such as this one -> https://fluentuipr.z22.web.core.windows.net/heads/master/theming-designer/index.html
STEP 2: Use this tool to enter the Hex Codes for your Primary Color, Text Color and Background Color as required, e.g.,
STEP 3: Export the Theme using PowerShell Format as shown here; simply copy the code into a Notepad for later use :-)
STEP 4: Use PnP PowerShell to connect to the Admin URL of your SharePoint Tenant, e.g.,
Connect-SPOService -Url https://otagem-admin.sharepoint.com
STEP 5: Once connected, use PnP PowerShell to define a simple variable called $theme, and set it to the code block you copied in STEP 3, e.g.,
$theme=@{
"themePrimary" = "#e81c30";
"themeLighterAlt" = "#fef5f6";
"themeLighter" = "#fbd8db";
"themeLight" = "#f8b7bd";
"themeTertiary" = "#f1727f";
"themeSecondary" = "#eb3547";
"themeDarkAlt" = "#d1192b";
"themeDark" = "#b01525";
"themeDarker" = "#82101b";
"neutralLighterAlt" = "#faf9f8";
"neutralLighter" = "#f3f2f1";
"neutralLight" = "#edebe9";
"neutralQuaternaryAlt" = "#e1dfdd";
"neutralQuaternary" = "#d0d0d0";
"neutralTertiaryAlt" = "#c8c6c4";
"neutralTertiary" = "#a19f9d";
"neutralSecondary" = "#605e5c";
"neutralPrimaryAlt" = "#3b3a39";
"neutralPrimary" = "#323130";
"neutralDark" = "#201f1e";
"black" = "#000000";
"white" = "#ffffff";
}
STEP 6: Use PnP PowerShell to create a new Theme in SharePoint, based on the $theme variable defined in STEP 5, e.g.,
Add-SPOTheme -Identity “Otagem Theme” -Palette $theme -IsInverted $false
STEP 7: Once Done, back to SharePoint! Refresh your page, go to Site Settings -> Change the Look -> Themes, and your new scheme should now be there ready for use alongside the out of the box SharePoint Schemes!
A little bit of extra work to get the desired result, but it's worth it as it keeps your Marketing and Branding people happy, and makes your SharePoint Site look good! ☺️
留言