Where do we find this variable ? where is this CSS variable declared?

rachana_patel
ServiceNow Employee
ServiceNow Employee

Hi , 

 

As in screenshot , background-color CSS property has been assigned a value which is stored in a variable $sc-field-error-color . I want to change the value of this variable and unable to find it . please help me . 

 

it is stored in below file 

https://<instance-name>.service-now.com/now/nav/ui/classic/params/target/sp_widget.do%3Fsys_id%3D3c2... 

 

3 REPLIES 3

Amit Gujarathi
Giga Sage
Giga Sage

HI @rachana_patel ,
I trust you are doing great.

To change the value of the variable $sc-field-error-color in ServiceNow, you can follow these steps:

  1. Log in to your ServiceNow instance.
  2. Navigate to the "System Properties" module.
  3. In the left navigation pane, click on "CSS Variables."
  4. Search for the variable name sc-field-error-color.
  5. Once you find the variable, you can update its value to your desired color.

Here is a step-by-step guide:

  1. Log in to your ServiceNow instance using your credentials.
  2. On the homepage, click on the "System Properties" module. You can find it by typing "System Properties" in the navigation bar and selecting it from the search results.
  3. In the left navigation pane, locate and click on "CSS Variables." This will open the CSS Variables page.
  4. On the CSS Variables page, you will see a list of variables and their corresponding values.
  5. In the search bar at the top of the page, type sc-field-error-color and press Enter to search for the variable.
  6. Once the search results appear, locate the variable sc-field-error-color in the list.
  7. Click on the variable to open the editing panel.
  8. In the editing panel, you can update the value of the variable to your desired color. Simply replace the current value with the new color value.
  9. After updating the value, click on the "Save" button to save the changes.

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



There is no CSS Variables under System Properties. 
Also, those properties haven't been used for years. 

OP is talking about the Service Portal variable used by Cat Item Widget for CSM. Where it's specifically stated to use a variable named $sc-field-error-color. Which isn't defined anywhere as far as I can tell. But it does follow the @brand-danger variable set on the Portal record's CSS field. 

So if you want these to not behave the same way, just define $sc-field-error-color to something else.

Katarina Macisa
Tera Contributor

Hi, 

 

you can override it in the Theme (sp_theme record) used for portal or you can override it on Portal (sp_portal record). In both cases the new value should be put to the CSS variables field.

 

Use Theme to override is recommended though.