Ionic 4 - How to set an variable in variables.scss with class

Hi, I have two kinds of ion-items. header and item. I need to set a different background according to the class it has.

I’ve tried already to set in global.scss, separately.

ion-item .header {
  --ion-item-background: var(--ion-color-primary); // if I set this line of code in variables.scss works, but I can't make the difference between classes.
  background-color: black; // this line doesn't even work.
}

If I get rid of the class in global.scss it works, but I need it with the class, obviously.

Thanks for the time!