Using JavaScript in SharePoint Online how can I get the current site's theme name?

I'm writing a script that needs to make some decisions based on whether the site is set to the default "Office" theme or not.

I've found examples online of how to do something similar using server-side code and plenty on how to set the theme but there seems to be a lack of information on how to read the theme data through JavaScript.

1 Answer 1


You can get ThemeInfo of current site using JavaScript or REST API.


Make a GET request to /_api/Web/ThemeInfo. Test/Explore REST API using SharePoint REST Client.

enter image description here


var context = new SP.ClientContext.get_current();
var web = context.get_web();
var themeInfo = web.get_themeInfo();
context.executeQueryAsync(onSuccess, onError);

function onSuccess() {

function onError(sender, args) {

Find methods and properties of ThemeInfo here.

  • Thanks Atish. I'd come across ThemeInfo but I couldn't see from that how I can get the theme's title. So whether it's "Office","Sea Monster","Wood" etc. Sep 1, 2016 at 7:55
  • It seems it's not exposed in REST API or JSOM Sep 1, 2016 at 9:36
  • Thanks for confirming that Atish. I'll need to use a workaround in that case and see if I can use a combination of the get_accessibleDescription and get_themeBackgroundImageUri methods to work out a pattern with the theme. Sep 1, 2016 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.