# Ionic4 - updating toast scss not reflecting change

**URL:** <https://forum.ionicframework.com/t/ionic4-updating-toast-scss-not-reflecting-change/159694>\
**Category:** ionic-v3\
**Created:** [March 21, 2019, 10:23pm UTC](https://forum.ionicframework.com/t/ionic4-updating-toast-scss-not-reflecting-change/159694 "2019-03-21T22:23:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabbyCharles](https://avatars.discourse-cdn.com/v4/letter/g/90db22/32.png) [@gabbyCharles](https://forum.ionicframework.com/u/gabbyCharles)\
**Post date:** [March 21, 2019, 10:23pm UTC](https://forum.ionicframework.com/t/ionic4-updating-toast-scss-not-reflecting-change/159694/1 "2019-03-21T22:23:23Z")

</div>

I am attempting to update my toast scss to produce a toast that is red, centered black text , and height of 10px.

I have the following scss:

```auto
.toastCss {
        --height: 10px;	
        --color: #0000;
    }

```

and the following in my .ts file:

```auto
    this.dragulaService.removeModel('bag')
    .subscribe(({ item }) => {
      this.toastController.create({ 
            position: 'middle',
            message: 'Ops....',
            cssClass: 'toastCss',
            color: 'danger',
            duration: 2000
      }).then(toast => toast.present());
    });

```

The position and color of the toast displays correctly but cssClass is not being read.  
Any thoughts on why this may be .  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Fares95](https://avatars.discourse-cdn.com/v4/letter/f/6bbea6/32.png) [@Fares95](https://forum.ionicframework.com/u/Fares95)\
**Post date:** [March 22, 2019, 1:25am UTC](https://forum.ionicframework.com/t/ionic4-updating-toast-scss-not-reflecting-change/159694/2 "2019-03-22T01:25:03Z")

</div>

Hello ,  
i think the application give always priority Typescript .  
this is what always happens in any application ionic when you put some values to proprieties in your ts file  
and different values in css file the application choose always by default typescript values

---

<div class="post-metadata">

**Author:** ![joabchua](https://avatars.discourse-cdn.com/v4/letter/j/ce73a5/32.png) [@joabchua](https://forum.ionicframework.com/u/joabchua)\
**Post date:** [March 22, 2019, 2:21am UTC](https://forum.ionicframework.com/t/ionic4-updating-toast-scss-not-reflecting-change/159694/3 "2019-03-22T02:21:30Z")

</div>

He is right. Hence u can create update toast css through using custom typescript css.

> **[Create a Custom Modal Page Transition Animation in Ionic](https://www.joshmorony.com/create-a-custom-modal-page-transition-animation-in-ionic/)**
>
> In this tutorial, we walk through how to create a custom page transition animation for modals in Ionic.

Here is how you can create custom animation/css in typescript and import the methods into ur toast controller enterAnimation attribute and leaveAnimation attribute.

---

<div class="post-metadata">

**Author:** ![juny58](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/juny58/32/121837_2.png) [@juny58](https://forum.ionicframework.com/u/juny58)\
**Post date:** [March 22, 2019, 5:24am UTC](https://forum.ionicframework.com/t/ionic4-updating-toast-scss-not-reflecting-change/159694/4 "2019-03-22T05:24:46Z")

</div>

Use the css in global.scss

---

<div class="post-metadata">

**Author:** ![gabbyCharles](https://avatars.discourse-cdn.com/v4/letter/g/90db22/32.png) [@gabbyCharles](https://forum.ionicframework.com/u/gabbyCharles)\
**Post date:** [March 22, 2019, 11:07pm UTC](https://forum.ionicframework.com/t/ionic4-updating-toast-scss-not-reflecting-change/159694/6 "2019-03-22T23:07:26Z")

</div>

i also found that this could be updated using variable.scss

---

<div class="post-metadata">

**Author:** ![joabchua](https://avatars.discourse-cdn.com/v4/letter/j/ce73a5/32.png) [@joabchua](https://forum.ionicframework.com/u/joabchua)\
**Post date:** [March 23, 2019, 2:25am UTC](https://forum.ionicframework.com/t/ionic4-updating-toast-scss-not-reflecting-change/159694/7 "2019-03-23T02:25:12Z")

</div>

Yes. U can do that if the css4 variable is define for the properties that u want to change. Cheers.
