Using CSS variables in Field Styles.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2019 10:34 PM
I want to use color values from the themes for styling fields (Field Styles) in ServiceNow.The main idea of this - to enable users to have personal (themed) settings for coloring priority in tasks.
Here is a questions:
How to use these variables from Field style? At the moment I couldn't use any CSS variables in styles directly:
background-color:$search-text-color
Any ideas?
Regards, Nikolay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2019 09:18 PM
I don't need to change themes, I need to apply themed color to data fields in list. Themes in SN apply only for User Interface, not to the data fields in lists. I need to apply colors from themes to data fields according to certain rules. I know how to set the rules - the field "Condition" allows using javascript. But I can`t assign colour in field "Style" because I don`t have access to colour variables from user theme.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2019 02:27 AM
It seems to me that correct referencing of CSS variables would be ${$varname} instead of $varname used in Service Portal.
You can search in style sheets found under Content Management > Design > Style Sheets for "${$" and will find some usage of variables defined in System UI > Themes.