@chinazha: I am also having the same trouble. If I may ask, where exactly was your cssClass âalertDangerâ defined? Can you pls provide similar steps to achieve custom styles for an alert component in Ionic 2 app.
@piyukore, Thanks for your response. I have defined my css class but my challenge is; where do i put the css class. In the scss of the page using the Alert component or somewhere else?. I tried for alerts, loading and datetimepicker components but none seems to be working at all.
Yes i did import all scss for all the pages in my app.core.css.
So can i add the alertDanger (as an example) in app.core.css OR in the page class say home.scss?. Which is the most accurate. Putting the alertDanger in either app.core.css or home.scss did not actually work to reflect the css.
@piyukore & @chinazha Thanks so much for your help. Its now very ok. But have you guys tried the same technique on the loading component. Styles ainât applying to that so far.
}
else {//we launch the getNearestPlaces function
this.getNearestPlaces();
}
})
}
else {//if the platform is not execute in cordova we launch the getNearestPlaces function directly
this.getNearestPlaces();
}
Whoever might have this problem, I added in the following:
.alert-ios .alert-wrapper{
button.alertButton{
background-color: red !important;
}
}
into app.scss (while adding the css class into the alert as described above).
Donât know if the file or the further specification â.alert-ios .alert-wrapperâ do the trick.
I have done the same thing. With just a couple of lines of CSS (in my app.css) I was able to completely restyle all of the Ionic alerts, popups etc and when I create them I simply apply a single, root cssClass. Works beautifully.