Ion-segment-button CSS custom properties

I would like to change the ion segment button color when it is checked. I tried to write the CSS code at variables.css file as well, however no success.
Below is the code :

      color: white; 
      --color-checked: var(--ion-color-danger);
     --background-activated: black!important; 
    --background-checked: var(--ion-color-primary); 
    --indicator-color: transparent!important; 

Only change is via color property. Other CSS properties are just ignored: /

Any help will be appreciated.

I need some help too, if someone found the answer to this !