Issue
I want to change the color of the selected label. I'm using --color-selected in CSS, but it doesn't work.
Html
<ng-container *ngFor="let item of daily">
<ion-label id="daysName" class="favorites-label" (click)="dayName($event)">{{item.day}}</ion-label>
</ng-container>
TS
dayName($event) {
console.log('dayName', $event.target.innerHTML)
}
CSS
#daysName {
color: white;
--color-selected: red;
}
ion-label.favorites-label {
--color-selected: red;
}
Solution
You can use ngClass:
[ngClass]="{'favorites-label': step === 'step1'}"
Or
[class.favorites-labels] = "step === 'step1'"
Answered By - StackoverBlows
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.