Change list background color on press


#1

I would like to change the list background color when you click on it? Currently, it does the default grey, but I want a red for example. I am not sure how this functions or what class or pseudo class to play with.


#2

Hi,

Are you referring to changing the background colour (defaults to grey) of a list item when you click it?

Ionic adds the class ‘activated’ (or ‘active’ for older versions) to a list item that is being clicked, so you can just provide your own custom styles to over write the following default ionic style

.item.active, .item.activated, .item-complex.active .item-content, .item-complex.activated .item-content {
border-color: #ccc;
background-color: #D9D9D9;
}

Hope this is helpful


#3

That did it! Thanks!


#4

How do you make this specific to the sidemun list when you are using ion list in other templates in your application