# How to change the css for Toast in Ionic 2

**URL:** <https://forum.ionicframework.com/t/how-to-change-the-css-for-toast-in-ionic-2/56401>\
**Category:** ionic-v3\
**Created:** [July 1, 2016, 12:28pm UTC](https://forum.ionicframework.com/t/how-to-change-the-css-for-toast-in-ionic-2/56401 "2016-07-01T12:28:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![AishApp](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@AishApp](https://forum.ionicframework.com/u/AishApp)\
**Post date:** [July 1, 2016, 12:28pm UTC](https://forum.ionicframework.com/t/how-to-change-the-css-for-toast-in-ionic-2/56401/1 "2016-07-01T12:28:33Z")

</div>

Hi. I tried changing the css property of toast message in my scss as below.

> ```
> .toast-message{
> background: white;
> }
> 
> ```

But i couldn’t see any changes getting reflected. Please let me know how to change the css property for toast

---

<div class="post-metadata">

**Author:** ![piyukore](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/piyukore/32/102073_2.png) [@piyukore](https://forum.ionicframework.com/u/piyukore)\
**Post date:** [July 1, 2016, 12:39pm UTC](https://forum.ionicframework.com/t/how-to-change-the-css-for-toast-in-ionic-2/56401/2 "2016-07-01T12:39:22Z")

</div>

the class for toast styles is toast-container

.toast-container{  
background-color: white;  
}

this worked for me

---

<div class="post-metadata">

**Author:** ![AishApp](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@AishApp](https://forum.ionicframework.com/u/AishApp)\
**Post date:** [July 2, 2016, 5:27am UTC](https://forum.ionicframework.com/t/how-to-change-the-css-for-toast-in-ionic-2/56401/3 "2016-07-02T05:27:30Z")

</div>

Thanks for your reply @piyukore. I got it by editing the .toast-message class itself. Due to some blender mistake i didnt get. Thanks for your valuable time. 🙂

---

<div class="post-metadata">

**Author:** ![heykamok](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/heykamok/32/104933_2.png) [@heykamok](https://forum.ionicframework.com/u/heykamok)\
**Post date:** [December 28, 2016, 6:54pm UTC](https://forum.ionicframework.com/t/how-to-change-the-css-for-toast-in-ionic-2/56401/4 "2016-12-28T18:54:09Z")

</div>

For some reason, nothing I do changes the css of the toast. I even tried the cssClass parameter on creation of the toast, but that doesn’t show up either when I inspect it.

---

<div class="post-metadata">

**Author:** ![lucasbasquerotto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lucasbasquerotto/32/101719_2.png) [@lucasbasquerotto](https://forum.ionicframework.com/u/lucasbasquerotto)\
**Post date:** [December 29, 2016, 10:39am UTC](https://forum.ionicframework.com/t/how-to-change-the-css-for-toast-in-ionic-2/56401/5 "2016-12-29T10:39:50Z")

</div>

@heykamok I use toast with the `cssClass` with values of `success` or `error`, for example. With these classes (it’s easy to customize other classes), **the following worked for me:**

```
ion-toast.success .toast-wrapper {
	background: green;
}

ion-toast.error .toast-wrapper {
	background: rgb(209, 71, 71);
}
```

---

<div class="post-metadata">

**Author:** ![heykamok](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/heykamok/32/104933_2.png) [@heykamok](https://forum.ionicframework.com/u/heykamok)\
**Post date:** [December 29, 2016, 5:37pm UTC](https://forum.ionicframework.com/t/how-to-change-the-css-for-toast-in-ionic-2/56401/6 "2016-12-29T17:37:36Z")

</div>

Hello. Thanks for replying. I figured it out by using `cssClass`. Turns out, in the `scss` file where you declare the css for the class you put in `cssClass`, you have to put it OUTSIDE of the page’s selector in order to work. I also had to make it target the next div, using something like `> div { color: red; }`.

Thanks!

---

<div class="post-metadata">

**Author:** ![Sreekanth\_Karini](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@Sreekanth\_Karini](https://forum.ionicframework.com/u/Sreekanth_Karini)\
**Post date:** [January 31, 2018, 1:25pm UTC](https://forum.ionicframework.com/t/how-to-change-the-css-for-toast-in-ionic-2/56401/7 "2018-01-31T13:25:25Z")

</div>

Put these in your project theme/variable.css

Example:  
For Android:  
$toast-md-background: red;   
$toast-md-title-color: white;

For iOS:  
$toast-ios-background: red;   
$toast-ios-title-color: white;

ref: check sass variables in below link

> **[Ionic Framework](https://ionicframework.com/docs/api/components/toast/ToastController/#sass-variables)**
>
> Ionic is the app platform for web developers. Build amazing mobile, web, and desktop apps all with one shared code base and open web standards

---

<div class="post-metadata">

**Author:** ![jgv66](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@jgv66](https://forum.ionicframework.com/u/jgv66)\
**Post date:** [February 20, 2018, 1:32pm UTC](https://forum.ionicframework.com/t/how-to-change-the-css-for-toast-in-ionic-2/56401/8 "2018-02-20T13:32:32Z")

</div>

for my works fine like this:

.toast-container{  
background-color: color($colors,“primary”);  
text-align: center;  
}

tnks a lot.
