我正在使用ion-select来选择选项,我想更改离子选项的文本颜色。我的代码如下......
<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>
这样做没有Sass变量。我尝试过使用CSS和样式,但它不起作用。任何人都可以帮我改变离子选项的文字颜色吗?
我能够通过插入ion-options
来改变文本颜色(所有app.scss
)
.item-radio.item ion-label {
color: red; //your color here
}
对于选定的选项,将!important
插入颜色属性
.item-radio-checked.item ion-label {
color: blue !important; //your color here for selected option
}