I have an ion-select with some ion-options and i’m trying to set some background color wich depends on the value of the ion-option. So the background of each ion-option might be different (red, blue, orange…).
I tried to add a class to the ion-option, it just doesnt show in the HTML so i can’t style it. So if any of you guys can add a class to that sort of element, let me know !!
The Select docs suggest that you can use an ActionSheet, which has a cssClass attribute for its buttons. I haven’t tried it, but might be worth looking into.
I don’t know what your particular situation is, but I was playing around with this and could create ion-options with each of them having their own specific background color. It might help you to know that I used the fact that an ion-select component implements the alert interface by default and I could pass it options with a custom class to tag it. Then I could easily target that select and the options it has with some advanced css selectors.
I believe there is still a better way to do it, for example we could give each ion-option its own id so that we don’t have to do much in selecting them with css. But for now this is enough playing around for me