The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Ashley Snyder
ServiceNow Employee
ServiceNow Employee
 Center of Excellence / Next Experience / Create your first Next Experience UI Theme

 

 

This guide has been updated for the Utah release to include our latest product for creating a core theme - Theme Builder. 

 

Create a Theme with Theme Builder (Utah+)

Manual Theme Creation (Tokyo/San Diego)

 

Create a Theme with Theme Builder (Utah+)

 

 

If you're on Utah+ then head over to the Theme Builder product documentation and watch our Creator Toolbox and Academy on how to create a theme with Theme Builder. Theme Builder is a Store download that can be downloaded on your Utah instance and Utah PDI.

 

As a quick overview, Theme Builder allows your to manage, edit, and implement Next Experience themes easily. You can use Theme Builder to create your core brand theme, and then add variants manually by updating the style record.

 

Theme Builder enables you to quickly perform the following in a matter of clicks:

 

  • Define branding colors
  • Preview branding colors on multiple experiences
  • Choose a font
  • Upload a logo
  • Define visual elements such as rounded corners

 

 

Manual Theme Creation (San Diego/Tokyo)

 

This portion will walk you through setting up a core theme in San Diego/Tokyo. This guide will only cover some basic color elements, and will not extend into changing fonts, shape and form, classic dashboard styling, logo, etc. For questions on setting your company logo, see the product documentation.

 

Step 1. Create a Theme

 

 

It is best practice to create a new theme, and override the default shipped Polaris theme rather than adding styles on to the Polaris theme. To create a theme navigate to Now Experience Framework > Theme Management > Themes. From here, click the New button to create a new theme.

 

The only mandatory field here is Name, and you can name the theme whatever you'd like to denote that it's your organization's theme. I'll use Company Theme as a name for this theme.

 

CleanShot 2023-01-11 at 10.12.12.png

 

 

 

Step 2. Create a Core Color Style and re-use OOTB Styles

 

Note: As of Tokyo Patch 1 (you can also use this method in San Diego), it's important to include the Colors UX Style into your theme to prevent issues with checkbox styling. You can add it to your theme, leave the order as 0 and the type as Core. If you want this as a user selectable variant, you'll have to create a duplicate copy of the UX Style and add it in as a variant.

 

Since we're creating a Next Experience UI theme, we're going to work with the Compositional: App Theme UX Theme Styles records. The Legacy: Experience Theme tab can be used in the following scenarios: Portal and custom experiences regardless if Next Experience UI is enabled or not, and workspace experiences when Next Experience UI is not enabled. You'll notice when Next Experience is enabled that your Workspace theme cannot be edited in UI builder and is set to the Polaris theme by default, which we will override here.

 

Before we start defining our own colors, let's include some of the default styles from the Polaris theme so we can re-use them. The Polaris theme ships with styles for shape and form (i.e. corners, borders, etc.) fonts, Classic Dashboard styling, etc. This article is using the assumption that we want to re-use these and not change them, but you do have the option of creating your own style records for fonts, shape and form, etc.

 

On your UX Theme record, associate the following styles:

 

CleanShot 2023-01-11 at 10.18.49.png

 

Now you're ready to create a UX Style for your company's colors. Let's begin by defining three colors you'll need to use:

 

1. Primary, in my example I'm going to use #666666, and use an online Hex to RGB converter to get the RBG value: 102, 102, 102
2. Secondary: #999999 with RBG: 153, 153, 153
3. Neutral: I'm going to use the same as my secondary, but this could be different.

 

Now we're going to create a UX Style that will override the default Colors style. You can give the UX Style a name, in my example Company Colors and a Type of Core. In the Style box, enter the following to change the theme:

 

 

 

 

{
    "base": {
        "--now-color--neutral": "153,153,153",
        "--now-color--primary": "102,102,102",
        "--now-color--secondary": "153,153,153",
        "--now-color_chrome--brand": "102,102,102"
    },
    "properties": {
        "--now-color_brand--neutral": "153,153,153",
        "--now-color_brand--primary": "102,102,102",
        "--now-color_brand--secondary": "153,153,153"
    }
}

 

 

 

 

Note: You can also use this customer facing site to auto-generate a site based upon your three branding colors, but sure to include the copied JSON in braced such as:

 

 

 

{ "properties": [ENTER THE COPIED JSON HERE, IT WILL INCLUDE IT'S OWN BRACES]
}

 

 

 

Your UX Style should look like this:

 

CleanShot 2023-01-11 at 10.22.10.png

 

In the UX Theme record, give your new UX Style an Order of 1 in order to override the Colors style, and allow anything not found in your UX Style variables to be picked up by the lower order Colors style.

 

CleanShot 2023-01-11 at 10.24.32.png

 

 

Step 3. Override the Default Theme

 

Now that we have a Core style and a new theme, before we proceed to creating variants, let's test the theme and override the default Polaris theme. Note: To use this method you must be on San Diego Patch 1 or higher.

1. Copy the UX Theme sys_id by right clicking the header and selecting Copy sys_id.

2. In the Application Navigator navigate to sys_properties.list.

3. Create a new system property named: glide.ui.polaris.theme.custom with the Type of string.

4. Enter your copied sys_id into the Value field.

5. Save the record.

 

find_real_file.png

 

You'll notice your theme will load after saving, perform a browser refresh to get the full theme. 

 

CleanShot 2023-01-11 at 10.34.07.png

 

 

Step 4. Create a User Selectable Color Variant

 

You'll notice if you head over to User Preferences that the Themes panel is not visible, even though you have glide.ui.polaris.dark_themes_enabled set to true. This is because the theme itself does not contain a variant and in the absence of a variant associated to the Theme, that option will not show for users. Let's add a variant to our theme.

 

Navigate back to the theme you created in Step 1. Under Compositional: App theme, we're going to add a new row:

 

Applicability: Leave Blank

Order: 0

Type: Variant

Style: Create a new UX Style record with your desired colors and naming, in this example we're going to be using Greens:

 

 

 

 

{
    "base": {
        "--now-color--neutral": "127,175,92",
        "--now-color--primary": "57,145,48",
        "--now-color--secondary": "127,175,92",
        "--now-color_chrome--brand": "57,145,48"
    },
    "properties": {
        "--now-color_brand--neutral": "127,175,92",
        "--now-color_brand--primary": "57,145,48",
        "--now-color_brand--secondary": "127,175,92"
    }
}

 

 

 

 

Note: You can also use this customer facing site to auto-generate a site based upon your three branding colors, but sure to include the copied JSON in braced such as:

 

 

 

 

{ "properties": [ENTER THE COPIED JSON HERE, IT WILL INCLUDE IT'S OWN BRACES]
}

 

 

 

 

 

CleanShot 2023-01-11 at 11.00.48.png

 

Ensure the style is associated to your theme with the Type of Variant, it should look like the following:

 

CleanShot 2023-01-11 at 11.01.28.png

 

Save the UX Theme record. Refresh the browser window, and now you'll see the Themes panel under User Preferences and your new variant.

 

CleanShot 2023-01-11 at 11.01.58.png

 

CleanShot 2023-01-11 at 11.02.37.png

 

Hopefully by the end of this guide you're more comfortable with creating a theme to override the default Polaris theme for Next Experience, and how to create a Core style and a user selectable Variant. While this article covered the basics, there's more you can do with Style applicability, adding fonts, logos, and more. See the product documentation to go deeper on theming and for more of a deep dive on when themes are applied and fundamentals of CSS variables, see our article on Next Experience UI Theming.

 

Comments
Jason Nichols
ServiceNow Employee
ServiceNow Employee

Thanks Ashley for the detailed instructions. I would like to add that you need at least San Diego Patch 1, which includes a fix for PRB1556654, which prevented the default theme from being overridden. (I experienced this in my PDI which only had Patch 0 Hotfix 1.)

Ashley Snyder
ServiceNow Employee
ServiceNow Employee

Thank you @Jason Nichols for pointing that out, I've added this to the original documentation.

ctsmith
Tera Guru

Any thoughts on what scope to build this out in?  Just stick with Global?  Or like Polaris = sn-themes?

And if you build a theme per instance, automatically protected in clone or need to do an exclusion?

Thank you!!

Anisse Mahtat
Tera Contributor

Thanks Ashley !

Jake Mcclelland
Mega Contributor

I have tried a test run of this in a personal developer instance before running it in my organisation's dev instances, I've followed all of the steps exactly, and when I went to refresh the home screen for my PDI I now just get a blank white screen, has anyone else experienced this and do they know what the cause may be?

 

Thanks!

tylerdrobinson1
ServiceNow Employee
ServiceNow Employee

Just walked through this as well, and received the same issue that Jake mentioned (both a DemoHub instance, and PDI).

Verified that I was running San Diego Patch 5.

Jason Nichols
ServiceNow Employee
ServiceNow Employee

Hi Jake & Tyler,

I found a ServiceNow Support known error article that describes this issue and a documents a workaround: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1080252 (login required).

You will need to navigate to /sys_ux_theme_list.do and remove the Core style that you added and also revert back to your default Polaris theme by navigating to /sys_properties.do?sys_id=f1f5b45b2ff3c1109ee53996f699b6f2. The sys_id of the default ServiceNow Polaris theme is 31bf91ae07203010e03948f78ad30095.

Apparently it is an intermittent issue related to stylesheets not being correctly applied. Perhaps Ashley knows more.

Frans Brus - No
Giga Guru

Is it possible to have another banner image for Darkmode without creating a complete new theme?
I'm happy with Darkmode but only our company logo is not visible because it contains Black characters.

Before there was a system property 'glide.product.image.light'
Could be great if 'glide.product.image.dark' would be introduced to show another image on Darkmode.

Kyleigh Knight
Tera Explorer

Hey Frans. Have you tried using the [UX Style Assets] - polaris_header_logo and adding that to the Dark theme? This is initially setup in the Imagery UX Style under the Polaris theme using the Now logo. 

Basically, add that to both the default theme (light) and to the dark theme. In my instance, I have it overwritten (currently) by the system's logo entered.

Kyleigh Knight
Tera Explorer

If you have any spaces in the rgb values like so "0, 0, 0". It will give you this white page. It has to be without spaces like so "0,0,0".

Mosh Jah_n1
Giga Expert

I set out to create a dark theme, and found that it was actually easier to create a dark theme that was a "light" theme as you have more control.  Wth "isDark" property in the JSON set to true, some additional color inversions seem to occur that I wasn't sure how to control (or if it was even possible to control that).

I was quite hard work to keep track of all the CSS variables at play, and ended up documenting it as I went. This is for San Diego, though I've noted some differences for Tokyo. Hope it's of use to others.

 

MoshJah_n1_0-1664823212367.png

 

Jeff A
Tera Explorer

Is there anyway to override a theme without access to the interface? I keep doing something wrong and getting a white screen that just errors out: 

createMacroponent.js:52

Uncaught (in promise) TypeError: Cannot destructure property 'id' of 'e' as it is undefined.
at Object.BN [as registerMacroponent] (createMacroponent.js:52:3)
at wp (createMacroponentFragmentGenerator.js:77:14)
at async f (getTemplates.js:83:11)

 

I think the error is I am trying to override too much but I'd really like to know if there is a way to recover from this state without resetting the instance. I assume in a full instance you may be able to do this through the sn help site, but I can't find a way to update my dev instance if I don't have a usable interface.

Rachael7
Tera Contributor

Great article! Now we just need to share cool themes we've created. I think I'll start a thread.

Stephen C
Mega Guru

Thank you, is there a way to create a Core Theme (easily).  We would like to set a default theme as something other than Polaris (Colors).  I have tried this but the Checkboxes (like you mentioned earlier) don't show as the CSS is off. 
Excellent article and came in handy.

zrebak
Kilo Guru

Hello,

 

The override works as expected (Tokyo Patch 1), however what worries me is that I cannot assign the theme only to the Agent Workspace.

I am seeing exactly the error as shown on the screen when entering Branding and Theming in CSM Configurable Workspace: "Polaris is the default theme for your instance."

I would like to just extend the Polaris theme with few amendments I did in Legacy Workspace, specifically to the gradient bar on the left-hand side of Workspace. Is there really no way to do this outside of replacing the theme globally? This goes against company branding strategy.

 

Attaching the screenshot of what I mean.

 

theme.PNG

 
Best regards,
x
Alex Cripps
Tera Contributor

Hi every one, 

How much has changed in Tokyo version comparted San Diego (next experience) . Any new features?  

 

Thanks 

Kim Sullivan
Mega Guru

On some of my variants, the tabs on the form are disappearing.  Anyone else see this or know why? (Ignore the color pairs - just doing some testing.)

Default theme:

KimSullivan_0-1667580490741.png

Variant:

KimSullivan_1-1667580516176.png

 

 

MarcB1
Tera Guru

@Kim Sullivan 

I had to modify my theme to this format to get it working:

MarcB1_0-1667803584998.png

 

Jefferson
Tera Expert

Amazing article! It worked just fine in my PDI.

 

I have a quick question though. If we want to have just the header for Dev, Test and Prod instances in different colours, just because we were used to this so we don't get confused, would we need to create 3 (three) different themes? And I assume after adding them to the custom system property it would be retained even if we clone over Dev and Test instances, right?

 

MarcB1
Tera Guru

@Jefferson 
I created a Cleanup Script on the Prod instance which runs on the target system after a clone and sets the newly created Variant as Default:

(function() {
	//Get Instance Name
	var instanceName = gs.getProperty('instance_name');
	
       //Define Color
	var color = '';
	if (instanceName == 'instance1') {
		color = '255,0,253';
	}
	else if(instanceName == 'instance2') {
		color = '0,202,75';
	}

	//Create Theme Variant
	var grSUS = new GlideRecord('sys_ux_style');
	grSUS.name = 'Test/Dev';
	grSUS.style = '{"isDark":"false","base":{"--now-unified-nav_header--background-color":"' + color + '"}}';
	grSUS.type = 'variant';
	var styleId = grSUS.insert();

	//Link Theme Variant to Polaris
	var grM2TS = new GlideRecord('m2m_theme_style');
	grM2TS.style = styleId;
	grM2TS.theme = '31bf91ae07203010e03948f78ad30095';
	grM2TS.insert();

	//Delete all User Preferences
	var grSUPDelete = new GlideRecord('sys_user_preference');
	grSUPDelete.addQuery('name', 'glide.ui.polaris.theme.variant');
	grSUPDelete.query();
	while(grSUPDelete.next()) {
		grSUPDelete.deleteRecord();
	}
	
	//Set System Default
	var grSUP = new GlideRecord('sys_user_preference');
	grSUP.system = true;
	grSUP.name = 'glide.ui.polaris.theme.variant';
	grSUP.value = styleId;
	grSUP.insert();
})();

regards Marc

 

stephenh1
Tera Contributor

Is the Color Generator down at the moment?

Paul Curwen
Mega Sage

The color generator url: https://theme.deoprototypes.com/color-generator-p/ 

 

seems to be unavailable at the moment.

 

Can some check and confirm if this is still something we can continue to use?

LorenzVdV
Tera Contributor

I had to set my custom colors UX style to order 1 for it to be applied. 

LorenzVdV_0-1670517662594.png

 

Valawman
Tera Contributor

The color generator site is unavailable.  Anyone know of its status or if there is an alternative source?

 

ColorGeneratorMessage.jpg

Mike_R
Kilo Patron
Kilo Patron

Frustrated by the color generator website being down, I decided to create my own little utility to set the themes in Polaris. This works very similar to the Basic Configurations for UI16 that we all know and love. I created this in just a couple of hours, without any custom tables. Would've been great if ServiceNow provided something so simple OOTB.

 

 

 

 

If there's enough demand for this I will publish it to the ServiceNow share.

 

https://myservicenowstuff.com/2022/12/15/polaris-next-experience-theme-generator/

 

 

 

 

 

Alex Cripps
Tera Contributor

Hi Mike,

That is excellent.   saves a lot of time by the looks of the video.  Can this be done for San Diego ? 

Valawman
Tera Contributor

Very nice!  Got my vote.

Thomas G
Giga Guru

Nice work, Mike_R
Got my vote too.


Best regards
Thomas

 

hcoburn
Tera Contributor

Looks great, @Mike_R 

Got my vote too.

Christophe R
Tera Explorer

Great Job @Mike_R,

Got my vote too.

 

Best Regards,

 

Christophe

Roy Wallimann
Tera Contributor

Hi @Ashley Snyder 

Some months ago I saw a youtube video in which you talked about the "Branding Manager" which should be available from the Tokyo Release.

RoyWallimann_0-1671199949898.jpeg

Unfortunately I haven't found anything regarding the Branding Manager in the Store or on Docs.

This UI would be very helpful to make the branding easier.

Regards,

Roy

Mike_R
Kilo Patron
Kilo Patron

@Alex Cripps , @Valawman , @Thomas G , @hcoburn , @Christophe R - thanks for the feedback!

 

@Roy Wallimann  - that's a great find. I'm also VERY curious when this will be released.

 

 

Mike_R
Kilo Patron
Kilo Patron

I published v1 of "Polaris/Next Experience Theme Generator" to the ServiceNow share

https://developer.servicenow.com/connect.do#!/share/contents/2483566_polarisnext_experience_theme_ge...

 

Version 1 is very basic and only creates one theme variant. I'm working on v2 which will be more robust. 

I'm open to feedback.

Sean Cosgrove2
Tera Contributor

@Ashley Snyder 

 

Bad news everyone.  ServiceNow seems to have pulled the rug out from us all.  Even though using the color generator is clearly listed as part of the theming instructions in this post, AND ALSO IN THE PRODUCT DOCS, they have apparently restricted access to only ServiceNow employees. 

 

This is one of the most frustrating things ServiceNow has done.  Make it way too hard to simply brand and configure the colors of your instance, then remove a required tool that made it slightly less painful. 

 

Here's the response from the HI "support" case I created.

 

sngarbage.JPG

 

Ashley Snyder
ServiceNow Employee
ServiceNow Employee

The color generator site is down and the product documentation and article will be revised. At the time of the posting of the product documentation/article the site was customer facing and there has been some internal changes that are out of my control.

 

I'll point to some variables on this post shortly, but it looks like there are some helpful third party tools that have been posted that can be utilized in the mean time to generate themes quickly.

 

Stay tuned for Utah updates for theming enhancements.

Adam43
Tera Contributor

We keep one sub-instance on bleeding edge (called 'Next'- and it's already on Utah).  The rest are N-1 (in the process of going to Tokyo from SanDiego).  My question is- could I use ThemeBuilder in Utah and export the themes out to my other Tokyo subs?  any reliance on Utah tech for the actual theme records?

James Bustard
Kilo Sage

Great article. Thanks for sharing. 

 

We have a few themes now where I work. One thing which is bugging me, though, is the order they're displayed when you pick a theme; there doesn't seem to be any rhyme or reason to it.

 

Anyone know how to order the themes in the Theme picker? 

 

Regards

James

MGOPW
ServiceNow Employee
ServiceNow Employee

@James Bustard - Unfortunately there currently isn't a way to order the Variants displayed under the Themes section of the user preferences. 

MGOPW
ServiceNow Employee
ServiceNow Employee

@Adam43 - Hello! While you can export themes from your Utah instance to Tokyo instances, the hooks that the themes use to set the colors have changed between releases and therefore would not provide the same result in tokyo to match your utah instances. I would suggest theming them independently of each other. 

 

And just as a side note, any themes created outside of Theme Builder cannot be edited in theme builder once you upgrade. 

MGOPW
ServiceNow Employee
ServiceNow Employee

@Sean Cosgrove2 - Howdy! Just wanted to let you know that the Color Generator tool became public again a little bit ago. 🙂 https://theme.deoprototypes.com/color-generator-advanced 

MGOPW
ServiceNow Employee
ServiceNow Employee

@Mike_R @Roy Wallimann - Greetings! The Branding Manager has now been released in Utah as a Store Application renamed to "Theme Builder". 

StruHu
Tera Explorer

Dear Ashley,

we are currently in investigation into the Next Experience UI for our company and we used in the UI16 a svg file format for our instance logo (we are on tokyo) and this is not working in Next Experience UI. May be it is worthwile to update the product doc by adding the file types that are supported.

https://docs.servicenow.com/de-DE/bundle/utah-platform-user-interface/page/administer/navigation-and...

Kind regards

Marcel

Steven Herrmann
Giga Guru

@Ashley Snyder 

Has anyone figured out a way to change the text color for the global search?

Also, has anyone found a way to change the dashboard widget background colors?  The customer likes the colors just not for the global search (too hard to read) or the dashboard widgets but I have found no way to modify this.  

 

Capture.JPG
@Mike_R what you created is great!  Does it only work for Utah+ though?  My customer is on Tokyo.  

StruHu
Tera Explorer

@Ashley Snyder 

Is there somewhere existing a color defintion for values that are not existing as choices (invalid data in field) ? Depending on your color theme or variant it is tough to read, stakeholders asking to mark it in red or orange.

 

StruHu_0-1685689391239.png

 

MGOPW
ServiceNow Employee
ServiceNow Employee

@StruHu @Steven Herrmann 

 

Hello! To look for specific hooks, you should use the developer tools in your browser to take a look at the CSS code for the specific element you are looking for. I go over how to do this in this Live Coding Happy Hour live stream, where i give a few examples of hooks and how they work, and how to modify them in the theme record's JSON. 

 

Additionally, you can check this website for a list of hooks that might also be helpful. 

acenriquez-LS
Tera Explorer

We create theme builder themes in just one instance just so it is more convenient and quicker to test. In essence, themes were created for SandBox, DEV, TEST and PROD instances. Is there a correct way to promote all of them up the stack so they are available in theme builder manager/editor where we can apply (or edit) the appropriate one per instance?

 

I tried adding the UX Theme records into an update set and committing them into another instance but despite successful commit, they don't show up in theme builder manager/editor. TIA!

MGOPW
ServiceNow Employee
ServiceNow Employee

Hello @acenriquez-LS  - This experience is something we are currently looking into. The easiest way to go about this right now would be to install Theme Builder in each instance and then create the themes locally in each instance.

 

Did you also include the records in the "m2m_theme_style" table as well as the corresponding "sys_ux_style" records in your update set? Does your theme work if you directly set it as active using the system property?

 

Edit:

I was also unable to edit the theme in theme builder in a second instance, I am currently investigating if this is expected behavior. I was able to successfully use the theme by manually setting the "glide.ui.polaris.theme.custom" property to use the new theme's sys_id. 

 

Edit 2: 

The record that tells Theme Builder that this is an editable theme is in the "sys_ux_theme_customization" table, once you grab this record you can edit the theme in Theme Builder again.

acenriquez-LS
Tera Explorer

Thank you for providing specific details. Being new to this theme customization, I just went ahead and ported all newly created records from those 3 tables and the custom themes are now appearing in the manager and editor view. Will do more exploration on how to brand the themes in more detail. Thanks again.

Version history
Last update:
‎02-10-2023 06:54 AM
Updated by:
Contributors