CSS Classes and Rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi All,
does anyone figure it out how to apply CSS rules in UI Builder and what they are for? ServiceNow Docs regarding this topic is a joke.
Create custom style classes and rules • Australia Build or modify applications • Docs | ServiceNow
Has anyone ever figured it out how to for example apply some CSS on :hover?
Any help would be appreciated.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
So is this just a way of organizing classes that we intend to apply conditionally vs ones we don't? I did something very similar, but with "Classes" rather than "Rules". I suspect this would work exactly the same either way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
@Fernnn ,
yes its weired. For me classes are redundant there as components already have css in then co will just add class on top of class. That’s why I used rules instead of classes to apply new styling.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
IF(@item.value.hasOverride, "diagonal-stripe-background", "") (no JS required, just regular data binding)
Looks like with rules, you have to specify the ".", implying that you can also define ids and maybe other things. I tried to test using both but my dev instance is not behaving well. It may be time for a new one.
