jeudi 3 octobre 2019

Using if() css function to compare sizes with a unit

I basically have a css variable --my-variable that contains something like 250px (with the unit px). I want to apply style based on the size contained in that variable.

For example:

background-color: if( var(--my-variable) > 200px , green, red );

Seems that I can't compare this way... What am I doing wrong ? Any idea ?

I am using SCSS.

Thanks in advance

Aucun commentaire:

Enregistrer un commentaire