Mario Mario - 1 year ago 79
Sass (Sass) Question

Class style in Ionic 2 not working

I have an Ionic 2 app and have the following two files in pages/home folder:

home.html:

<ion-list-header class="list">Your List</ion-list-header>


home.scss:

.list {
color: green;
}


Any ideas why is this not working? The file is properly referenced and the rest of the styles are working properly, but whenever I use class attribute, it is not picking up the styles(tried putting class on other elements as well).

Answer Source

I tried it with every html element and it didn't work. Made the change in the .ts file for the live reload and it still didn't apply.

Then refreshed the page also and it kicked in.

I will advice refreshing everything when it comes to html/css and on ticking "Disable cache" in developer tools in Google chrome as well.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download