SOLVED

Modern Theme - Applying to a site without making it generally available to Site Owners

Copper Contributor

I have a requirement to create in the region of 100 SharePoint sites, each with a different colour theme. The requirements around the theme for each site can be met by using the Modern Theme functionality, however I don't want them to be visible as a theme for any other site owners to select. 

 

Is it possible to apply a modern theme to a site without it first being made widely available to the tenant and all other site owners? All examples I see of the modern theme functionality is that you first make it available to the tenant, then apply it to the site. The classic theming with a .spcolor file could be uploaded directly to a site, which I could do, but I'm keen to not rely on classic features.

2 Replies
best response confirmed by Ross McLean (Copper Contributor)
Solution

@Ross McLean Yes you can do this via the REST API.

Checkout this web part that David Warner and myself built. It allows you to specify the URL of the site and the theme you want to apply, without adding it to the Theme options.

https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/js-theme-manager

@Beau Cameron Excellent, thanks for this! I'll check out your code this week. Sounds exactly like what I need.

1 best response

Accepted Solutions
best response confirmed by Ross McLean (Copper Contributor)
Solution

@Ross McLean Yes you can do this via the REST API.

Checkout this web part that David Warner and myself built. It allows you to specify the URL of the site and the theme you want to apply, without adding it to the Theme options.

https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/js-theme-manager

View solution in original post