Search code examples
htmlionic-frameworkionic2ionic3ion-select

unable to change text color in ion-option when interface="popover"


I am using ion-select for selecting an option and i want to change the text color of ion-option. My code is as below...

<ion-item>
    <ion-select interface="popover" [(ngModel)]="selectedGrp" (ionChange)="changeGrp()">  
        <ion-option value="" selected disabled>Select</ion-option>
        <ion-option *ngFor="let item of List;let i = index" [value]="item">{{item.name}} </ion-option>
    </ion-select>
</ion-item>

There are no SASS Variables for doing this. I have tried by using css and styles but it's not working. Can any one help me to change the ion-option text color?


Solution

  • I was able to change the text color (of all ion-options) by inserting in app.scss

    .item-radio.item ion-label {
        color: red; //your color here
    }
    

    For the selected option, insert a !important to the color attribute

    .item-radio-checked.item ion-label {
        color: blue !important; //your color here for selected option
    }