What is the best way to style an item's background?


#1

Anyone have any suggestions for the most ionic-way to style an item’s background? I’m trying to make a list of downloads, and each item’s background will be styled to show how much of the download is completed.

I made a directive to inject a div that I can style to style the item contents, but because of the 15-pixel padding around item-content, it ends up having a huge empty space around it.


#2

Sounds cool :slight_smile:

How are you trying to style the background?

This is just off the top of my head, but you could watch the download state in the directive and then change a gradient by percentage as it downloads (I’m sure there are better/ niftier tricks).

Something like linear-gradient(to right, #000 -100%, #fff 100%) to linear-gradient(to right, #000 100%, #fff 100%).

Not sure there is really a “most ionic way” though.