Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hiulit/2bc54f2d839b68982b0467264652eeca to your computer and use it in GitHub Desktop.
Save hiulit/2bc54f2d839b68982b0467264652eeca to your computer and use it in GitHub Desktop.
Stylus variables usage with string interpolation (e.g. when using the calc() function)
$some-variable = 10px
body
width: "calc(100% - %s)" % $some-variable
// To use multiple variables wrap the values into round brackets.
$some-variable = 10px
$another-variable = 5px
body
width: "calc(100% - %s - %s)" % ($some-variable $another-variable)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment