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

Occasional 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 (Occasional Contributor)

@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.

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