css - Problems calling a SASS built-in function -
this question has answer here:
i have fragment of sass code:
@font-face { $rndnum: random(1000); font-family: myfont; src:url('fonts/myfont#{$rndnum}.svg') font-weight: bold; font-style: normal; }
i need put random number after name of font, know seems stupid operation, need it. problem following result:
@font-face { font-family: myfont; src:url('fonts/myfontrandom(1000).svg') /* <== here */ font-weight: bold; font-style: normal; }
the function not called reason... doing wrong?
something more...
i tried calling function percentage
:
@font-face { $rndnum: percentage(0.2); ...
and worked in case... looks not recognizing random
valid function...
have tried concatenating string?
src:url('fonts/myfont'+$rndnum+'.svg');
and have code $rndnum
being set since problem how variable set.
edit 1:
your code works me. need semi-colon after src
line?
what version of sass using?
i tried here , seemed work fine on sass version 3.3.3 not on version 3.2.15 (the 2 versions offered on site).
Comments
Post a Comment