I have a list of ion items, each displaying a round ion-avatar image with a colored border. Currently, I can only set one fixed color for all items. However, I would like each item to have a different color based on the value of listItem.color.
Here is the code for setting a fixed color:
CSS:
.item-md ion-avatar img {
width: 60px !important;
height: 60px !important;
border-radius: 50% !important;
overflow: hidden !important;
border: 2px solid #fce515 !important;
}
html:
<ion-list class="wrapping-list">
<ion-item no-lines *ngFor="let listItem of list; let i = index" (click)="seeListItem(i)" (long-press)="longPressListItem(i)" (swipe-left)="swipeLeftItem(i)">
<ion-avatar item-left>
<img width="73px" height="43px" src="{{listItem.thumbnail}}" />
</ion-avatar>
<h2 class="title-text" >{{ listItem.name }} </h2>
</ion-item>
</ion-list>
I am looking for a way to dynamically set the border color according to the value in listItem.color.