1
votes

I'm trying to use [ngClass] to dynamically change the --bullet-background-active color for the Ionic Slide based on this article.

<ion-slides pager="true" [ngStyle]="{'--bullet-background-active':BulletColorVar}">

However, it does not seem to work specifically for Ionic custom CSS properties.

Any ideas how to fix this?

1
did you solved this problem? I have the same. Chrome comes up with this "ng-reflect-ng-style="[object Object]" " - Janneck Lange

1 Answers

0
votes

try using style.setProperty(propertyName, value, priority) function

CSS

ion-slides {
   --bullet-background-active: --bullet-color-var
}

TS

document.body.style.setProperty('--bullet-color-var', BulletColorVar)