Ionic5 - Unable to change the color of toast cancel button

I tried everything but unable to change the color of toast cancel button

this.toastCtrl.create({
message: messageInput,
position: ‘top’,
buttons: [
{
text: ‘x’,
role: ‘cancel’,
cssClass: ‘failuretoast1’,
handler: () => {
// Utils.log(‘Close clicked’);
}
}
],
cssClass: “failuretoast1”,
});

ion-toast.failuretoast1 {
color: orange !important;
–color: orange !important;
–button-color: #99226e !important;
}

.failuretoast1 {
color: orange !important;
–color: orange !important;
–button-color: #99226e !important;
}

Nothing works :frowning:

Css on inspect shows - toast-button-cancel and I am not able to change the color in this.

Please help

2 Likes