The visual appearance of SharePoint sites plays a key role in user experience and corporate identity...
Use the Fluent UI Theme Designer: https://aka.ms/themedesigner
# β οΈ This script must be executed in Windows PowerShell 5.x with administrator privileges!- # Recommended: Windows PowerShell 5.x (not PowerShell 7)
- # -----------------------------------------
- # Step 0: Install SharePoint Online Management Shell (if not already installed)
- # Note: Only run this if the module is not installed yet
- # -----------------------------------------
- if (-not (Get-Module -ListAvailable -Name Microsoft.Online.SharePoint.PowerShell)) {
- Write-Host "Installing SharePoint Online Management Shell..." -ForegroundColor Cyan
- Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser -Force
- }
- Import-Module Microsoft.Online.SharePoint.PowerShell -ErrorAction Stop
- Write-Host "SharePoint Online PowerShell module loaded." -ForegroundColor Green
- # -----------------------------------------
- # Step 1: Connect to the SharePoint Admin Center
- # -----------------------------------------
- $adminUrl = "https://<your-tenant-name>-admin.sharepoint.com"
- Write-Host "Connecting to: $adminUrl" -ForegroundColor Cyan
- Connect-SPOService -Url $adminUrl
- # -----------------------------------------
- # Step 2: Define the theme
- # -----------------------------------------
- $themeName = "Teamsware Purple"
- $palette = @{
- "themePrimary" = "#6667AB";
- "themeLighterAlt" = "#f8f8fc";
- "themeLighter" = "#e2e2f2";
- "themeLight" = "#cacbe6";
- "themeTertiary" = "#9b9ccd";
- "themeSecondary" = "#7576b5";
- "themeDarkAlt" = "#5c5d9a";
- "themeDark" = "#4e4f82";
- "themeDarker" = "#393a60";
- "neutralLighterAlt" = "#faf9f8";
- "neutralLighter" = "#f3f2f1";
- "neutralLight" = "#edebe9";
- "neutralQuaternaryAlt" = "#e1dfdd";
- "neutralQuaternary" = "#d0d0d0";
- "neutralTertiaryAlt" = "#c8c6c4";
- "neutralTertiary" = "#a19f9d";
- "neutralSecondary" = "#605e5c";
- "neutralSecondaryAlt" = "#8a8886";
- "neutralPrimaryAlt" = "#3b3a39";
- "neutralPrimary" = "#323130";
- "neutralDark" = "#201f1e";
- "black" = "#000000";
- "white" = "#ffffff"
- }
- # -----------------------------------------
- # Step 3: Remove existing theme (optional)
- # -----------------------------------------
- Write-Host "Checking if the theme already exists..." -ForegroundColor Cyan
- try {
- Remove-SPOTheme -Name $themeName -ErrorAction Stop
- Write-Host "Existing theme '$themeName' has been removed." -ForegroundColor Yellow
- }
- catch {
- Write-Host "No existing theme named '$themeName' found. Continuing..." -ForegroundColor Gray
- }
- # -----------------------------------------
- # Step 4: Add the new theme
- # -----------------------------------------
- try {
- Add-SPOTheme -Name $themeName -Palette $palette -IsInverted:$false -ErrorAction Stop
- Write-Host "β Theme '$themeName' successfully registered tenant-wide." -ForegroundColor Green
- }
- catch {
- Write-Host "β Error adding the theme: $($_.Exception.Message)" -ForegroundColor Red
- }
$adminUrl = "https://<your-tenant-name>-admin.sharepoint.com"
Connect-SPOService -Url $adminUrl
$themeName = "Teamsware Purple"
Remove-SPOTheme -Name $themeName
$adminUrl = "https://<your-tenant-name>-admin.sharepoint.com"
Connect-SPOService -Url $adminUrl
$themes = Get-SPOTheme
foreach ($theme in $themes) {
Remove-SPOTheme -Name $theme.Name
}
Only 32 color slots are supportedAdvanced semantic slots likebuttonBackgroundare derived automatically
.button {background-color: "[theme: buttonBackground, default: #f3f2f1]";color: "[theme: buttonText, default: #323130]";}
Get-Module -ListAvailable -Name Microsoft.Online.SharePoint.PowerShellInstall-Module -Name Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser -ForceImport-Module Microsoft.Online.SharePoint.PowerShellNote: The information and scripts provided in this article have been created with great care. However, Teamsware GmbH assumes no liability for the accuracy, completeness, or timeliness of the content. Use of the provided information is at your own risk. Please test all scripts in a suitable test environment before using them in production.