The CreatorCon Call for Content is officially open! Get started here.

How to display green text and background instead of blue text and background for addInfoMessage?

dianemiro
Kilo Sage

Hi Everyone,

I am displaying an informational message from Server Script. How can I make this in green instead of blue?

Regards,
Diane

1 ACCEPTED SOLUTION

dianemiro
Kilo Sage

Thank you all! The one provided by Deepankar is the same as Mohith and this only change the font color but not the background color. I ended up adding a Page Specific CSS by going to the Page Designer. Closing this thread!

find_real_file.png

View solution in original post

9 REPLIES 9

The SN Nerd
Giga Sage
Giga Sage

Is this for UI16?

If so, the CSS variables you can use in your UI Theme (System UI > Themes) record are as follows:

$color-info-light: #D0D0CE 
$color-info-dark: #333F48 

 find_real_file.png

Note I have only tested for the client side. Results may vary.


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Hi Paul,

This is for Service Portal. I want to change it on a specific page only and not system wide.

Regards,
Diane

Mohith Devatte
Tera Sage
Tera Sage

Hello @Diane Miro 

You can follow bellow approach

var text = '<div style="background-color:green;color:white">Color Changed<br/>';
g_form.addInfoMessage(text);

Please mark my answer correct if it helps you

Hi Mohith,

How about the background color? Thank you!

Regards,
Diane