Using CSS from current theme in UI pages

Stephen W_
Giga Guru

I know I can reference CSS from an actual stylesheet:

http://www.john-james-andersen.com/blog/service-now/flexible-styling-servicenow-ui-pages-macros.html

However, themes in ServiceNow, though they are nothing more than CSS are not technically CSS files..

How can I reference the current theme and include it along with my form specific CSS?

Alternatively, is it possible to evaluate a jelly variable to inject it's value into the "Style" element?

Thanks,

-Stephen

2 REPLIES 2

Brad Tilton
ServiceNow Employee
ServiceNow Employee

I think the themes are in stylesheets and I think you may be able to include it where the style href is something like:



/styles/css_includes_navpage14.cssx?v=08-03-2015_1347&c=2014-12-16_13:32:17_9fdfc38a4fe2c20067d9b5e18110c7b8&theme=<sysid of theme>



You can also define styles inline on your ui page and use jelly variables for the values.


Thanks Brad,



Inline makes sense, since those take strings.


Not as easy to dump an entire theme in, but I could certainly parse out a section of the theme and apply it to an element on the UI Page.