Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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).

like image 460
Mario Avatar asked Mar 17 '26 00:03

Mario


1 Answers

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 advise refreshing everything when it comes to html/css and on ticking "Disable cache" in developer tools in Google chrome as well.

like image 175
Kris Bonev Avatar answered Mar 19 '26 13:03

Kris Bonev