You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/declarative-customization/site-theming/sharepoint-site-theming-csom.md
+51-59Lines changed: 51 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: SharePoint site theming - CSOM development
3
3
description: The SharePoint client-side object model (CSOM) provides access to the SharePoint object model from code that is running locally or on a different server than SharePoint.
4
-
ms.date: 06/28/2022
4
+
ms.date: 02/25/2026
5
5
ms.localizationpriority: high
6
6
---
7
7
@@ -16,11 +16,11 @@ Before you get started, make sure that you're familiar with the following:
16
16
-[Using the Client Object Model](https://msdn.microsoft.com/library/ff798388.aspx)
17
17
-[Common Programming Tasks in the Managed Client Object Model](https://msdn.microsoft.com/library/ee537013.aspx)
18
18
19
-
You also need to reference the [Microsoft.SharePointOnline.CSOM](https://www.nuget.org/packages/Microsoft.SharePointOnline.CSOM/) NuGet package (version 16.1.6906.1200 or later).
19
+
You also need to reference the [Microsoft.SharePointOnline.CSOM](https://www.nuget.org/packages/Microsoft.SharePointOnline.CSOM/) NuGet package (version 16.0.27011.12008 or later).
20
20
21
21
## CSOM code example
22
22
23
-
The following example shows how to create a __Microsoft.Online.SharePoint.TenantAdministration.Tenant__ object and call the __GetAllTenantThemes__ method to return a list of themes.
23
+
The following example shows how to create a __Microsoft.Online.SharePoint.TenantAdministration.Tenant__ object and call the __GetAllGlobalThemes__ method to return a list of themes.
24
24
25
25
> [!NOTE]
26
26
> * The URL used to create the context object includes the _-admin_ suffix because **TenantAdministration** methods work with the admin site.
@@ -41,12 +41,12 @@ var passWord = new SecureString();
For methods that take a theme argument, the following code defines an __SPOTheme__ class that you can use to create custom themes.
49
+
For methods that take a theme argument, the following code defines an __SPOTheme__ class that you can use to create custom themes. For the new theme format, only the `Name` and `ColorPairs` properties are required. For the legacy theme format, the `Name`, `Palette`, and `IsInverted` properties are required.
50
50
51
51
```csharp
52
52
/// <summary>
@@ -67,6 +67,13 @@ public class SPOTheme
67
67
publicIDictionary<String, String>Palette
68
68
{
69
69
get; privateset;
70
+
}
71
+
/// <summary>
72
+
/// Specifies the color pairs setting of the theme.
/// Specifies whether the theme is inverted, with a dark background and a light foreground.
@@ -86,44 +93,31 @@ There's currently no supported CSOM API to programmatically apply a theme to a s
86
93
87
94
Use the following methods to customize the set of available themes for a SharePoint tenant administration site. You can add a new custom theme, update an existing theme, or delete a theme, and you can retrieve a specific theme or all themes. You can also hide or restore the default themes that come with SharePoint.
In multi-geo environments, themes added by an administrator in the primary geography are automatically propagated and available across the organization. This method is not supported for administrators in satellite geographies.
Retrieve all the themes that are currently available in the tenant, including any custom themes that have been added. Default themes are only included if the __HideDefaultThemes__ property is __false__ (the default value).
This property indicates whether the default themes are available in the theme picker UI. The default setting is __false__ (the default themes are available), but you might want to set this property to __true__ after you define custom themes, to allow only specific themes to be used.
116
+
Add a theme to the organization. This method is not supported for administrators in satellite geographies.
Retrieve the complete set of custom themes defined at the tenant level, including themes created through command-based tools and those created in the Brand Center UI.
140
+
> [!NOTE]
141
+
> To support consistent branding and simplify governance, theme management is transitioning to a centralized model.
142
+
> - The **primary geo** will act as the central location for **organization-wide theme creation and management**. Themes created here will be visible and applicable across satellite geos.
143
+
> - The satellite **Geo Administrators** will be able to view themes from the primary geo to their own sites by using `GetAllGlobalThemes` method. Themes previously created within satellite geos will remain available for use. However, **creating new themes in satellite geos will no longer be supported** going forward.
Retrieve all the themes that are currently available in the tenant, including any custom themes that have been added. Default themes are only included if the __HideDefaultThemes__ property is __false__ (the default value).
151
+
Retrieve all the custom themes that are created on current tenant through command-based tools.
This property indicates whether the default themes are available in the theme picker UI. The default setting is __false__ (the default themes are available), but you might want to set this property to __true__ after you define custom themes, to allow only specific themes to be used.
0 commit comments