aknuds1 aknuds1 - 26 days ago 12x
CSS Question

How to use a Stylus variable in calc?

In Stylus, how do I use a variable in a calc expression?

For example, the following doesn't work (

being a variable):

arrow-size = 5px
left calc(50% - arrow-size)


In order to use a Stylus variable inside a calc expression, one must use string interpolation:

arrow-size = 5px
left "calc(50% - %s)" % arrow-size