aknuds1 aknuds1 - 1 year ago 291
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)

Answer Source

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
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download