How to style a particular List widget (not all of them)?

Hello, I need to add custom style to the List widget using SASS. I tried to assign a custom class to the List widget, but most of the properties of the List elements, including list items, can be affected only via the special Mendix classes, originally located in the Lib folder, which are not displayed in the properties tab (eg. .mx-listview-item). So to style the List widget I have to work with those classes. The problem is that by editing SASS for those Mendix classes I affect all List widgets in the app. How can I affect only a particular List widget?  Thank you very much in advance!
1 answers

Hi Maxim, 

do the following.

  1. Add a custom class to the listview
  2. Add the class to the scss
  3. In the scss write you need to have the following:
.<custom-class-name> {
 & > .mx-list {
  & > .mx-listview-item {
   // Styling for all items

    &:first-child {
     //styling only affecting the first listview item 

Also have a look at CSS/SCSS selectors


Hope this helps,

Best regards