Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

224
Views
@if condition not working in scss when passing dynamic value from html?

In my html file i am passing value for --is-item-status as :-

<ion-label class="textColor label-md black-shade-light" style="--is-item-status: {{item.status}}" >{{item.status | formatEnum | async}}</ion-label>

(Note:- this is populated inside *ngFor condition).

in the browser i am able to see the value getting populated as :-

enter image description here

In my scss file i have code like :-

.textColor {
  @if var(--is-item-status) ==  'INVOICE_OPEN' {
    color: blue;
  } @else if var(--is-item-status) == ('PAYMENT_STATUS_CANCELLED'  or 'INVOICE_CANCELLED' or 'ORDER_CANCELLED') {
    color: red;
  } @else if var(--is-item-status) == ('PAYMENT_STATUS_PARTLY_APPLIED' or 'INVOICE_PARTLY_PAID' or 'ORDER_CLOSED') {
    color: black;
  } @else if var(--is-item-status) == ('PAYMENT_STATUS_APPLIED' or 'INVOICE_PARTLY_PAID' or 'ORDER_INVOICED') {
    color: green;
  }  @else {
    color: yellow;
  }
}

But the if conditions are not getting satisfied. Could someone tell me what am i doing wrong in this?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!