The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Any way to apply other CSS in UI Builder?

Andrew Bettcher
Kilo Sage

Hi everyone,

 

I'm working in ServiceNow UI Builder, customizing a Calendar timeline component. I'm trying to apply custom CSS styles via the component's Styles section to adjust the layout and text behaviour (e.g., white-space, overflow, etc.). This is a screen shot of my calendar:

AndrewBettcher_0-1754399048356.png

I've blurred the section header titles but you can see that they are truncated as they reach the end of the block before the calendar timelines section starts. I'd like the header titles to persist over that border so they fill the entire header section. So, it would like this:

AndrewBettcher_1-1754399437120.png

I found the bit of CSS that would need to be amended and confirmed it by updating it live using the inspection tool but when I tried to add the CSS to the calendar component, I get the error message saying:

 

“Only global CSS block will be considered”

This means local component-level CSS is not applied, and I'm unable to target specific internal elements such as .tm-section-head-default-content or .text-content.

 

  1. Where exactly should global CSS be defined if I want it to affect UI Builder components?

  2. Is there a way to safely target internal classes of the Calendar or Timeline component? Preferably without amending the theme record.


Any help or clarification would be greatly appreciated! Thanks in advance.

2 REPLIES 2

RaviAmbati
ServiceNow Employee
ServiceNow Employee

https://www.servicenow.com/docs/bundle/zurich-application-development/page/administer/ui-builder/tas... - you may need latest UI Builder store app and Yokohama version.

https://www.servicenow.com/community/in-other-news/ui-builder-themes-css/ba-p/2270788  - check this out to see.


Both require you editing the page in UI Builder and take ownership of the page.

It seems that the method described also strips out anything other than global CSS (although it doesn't give you a message telling you that in the rules editor).

I've tried using the least specific code possible to achieve what is required but it just won't accept it.

I've got a few other things to try. If I fix it I'll report back.