Powershell to Create Custom theme for Modern SharePoint Pages

I used the theming designer to get me started with the theme color set.
https://fabricweb.z5.web.core.windows.net/pr-deploy-site/refs/heads/7.0/theming-designer/index.html

I then changed a few colors directly to more match the specific cooperate color codes.
Easy as you please.

#Set Admin Center URL
$AdminCenterURL = "https://XXXXXXXXXXXXXXXXXXXXX.sharepoint.com/"
 
#Connect to Admin Center
Connect-PnPOnline -Url $AdminCenterURL -Interactive
 
#Define the color palette
$ThemePalette = @{
    "themePrimary" = "#313842";
    "themeLighterAlt" = "#f5f6f7";
    "themeLighter" = "#d7dbe1";
    "themeLight" = "#b7bdc6";
    "themeTertiary" = "#e26653";
    "themeSecondary" = "#de543e";
    "themeDarkAlt" = "#2c333c";
    "themeDark" = "#252b32";
    "themeDarker" = "#1b1f25";
    "neutralLighterAlt" = "#faf9f8";
    "neutralLighter" = "#f3f2f1";
    "neutralLight" = "#edebe9";
    "neutralQuaternaryAlt" = "#e1dfdd";
    "neutralQuaternary" = "#d0d0d0";
    "neutralTertiaryAlt" = "#c8c6c4";
    "neutralTertiary" = "#b7bdc6";
    "neutralSecondary" = "#78818e";
    "neutralSecondaryAlt" = "#78818e";
    "neutralPrimaryAlt" = "#454d59";
    "neutralPrimary" = "#313842";
    "neutralDark" = "#252b32";
    "black" = "#1b1f25";
    "white" = "#ffffff";
}
 
#powershell to add custom theme in SharePoint online 
Add-PnPTenantTheme -Overwrite -Identity "Corporate Theme" -Palette $ThemePalette -IsInverted $False

Comments

Popular posts from this blog

PowerShell PGP Decryption

JavaScript Broadcast Calendar Calculation