css - Concatenating variables in a Stylus mixin -


i'm trying make mixin generates styles variables, , concatenate 2 variables , can't make work. here example:

centersprite($icon)     margin-top -(($ico_+$icon+_height) / 2)     margin-left -(($ico_+$icon+_width) / 2) 

i have variable height , width of icon , to put name in arguments of mixin variable , make operation...

thanks in advance!

i don't know why (maybe bug?) when have minus before parenthesis in property value inside function stylus can't compile:

this code doesn't compile:

centersprite()     margin-top -((5 + 10 + 3) / 2)  body     centersprite() 

but 1 without function compile:

 body      margin-top -((5 + 10 + 3) / 2) 

and have discovered if use colons after property works in function:

stylus

centersprite()     margin-top: -((5 + 10 + 3) / 2)  body     centersprite() 

css

body {     margin-top: -9; } 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -