Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70443

How to change alert header and button color in ionic 5

$
0
0

@salad-gg wrote:

I have tried most options to change the color of header and buttons in ion-alert. What could be the solution?

async resetPin() {
const alert = await this.alertController.create({
header: ‘Reset Pin’,
cssClass:‘alertHeader’,
inputs: [
{
name: ‘phone’,
type: ‘number’,
placeholder: ‘Enter phone number’
}
],
buttons: [
{
text: ‘Cancel’,
role: ‘cancel’,
cssClass: ‘alertButton’,
handler: (blah) => {
alert.dismiss();
}
}, {

c.scss

.alertHeader {
color: #b52024 !important;
// --color: #b52024 !important;
}
h2.alertHeader {
color: #b52024 !important;
// --color: #b52024 !important;
}

//this works for alertHeader when inspecting in the browser
.alert-sub-title.sc-ion-alert-md, .alert-title.sc-ion-alert-md {
color: #b32224;
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>