Change list background color on press

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.

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 Likes

That did it! Thanks!

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