How do i write css for "item-native" calss?

i have tried to write css class for the “item-naltive” class in ion-item but it was not applied how can i write custom class for the “item-naltive” class

I am not pretty much sure but you can try this and remove padding of that element with class item-inner:

.item-inner{
padding:0 !important;
}

The use of shadow DOM has done a lot for protecting your styling, it also caused this issue.

This will solve your problem

ion-item::part(native) {
    //WRITE ALL YOUR CSS RULES HERE
    padding-left: unset;
    /** and lots more **/
  }

Meanwhile, there is also a guide on how to handle this issue and others caused as a result of shadow dom, you can solve them if you read the justice done by @brandyscarney - :ok_hand:t5: Read the post on IONIC Blog

3 Likes