0

How can I change the width value in ::before property dynamically? Want to achieve this:

ProgressBar

ts:

fillWidth: number = '50%';

html:

<div class="track">
  <div class="step featured-w" [ngStyle]="{'--featured-w': fillWidth}"></div>
</div>

CSS:

.track .step::before {
    height: 13px;
    position: absolute;
    content: "";
    width: var(--featured-w); // this is not working, to increase green part 
    left: 0;
    top: 15px;
}

I tried this: Assign variable to CSS

Pathik Vejani
  • 4,263
  • 8
  • 57
  • 98

0 Answers0