rplus.github.io
rplus.github.io copied to clipboard
[POST] Use a Stylus variable inside `calc()`
Use a Stylus variable inside calc()
a pen by Ana Tudor
http://codepen.io/thebabydino/pen/OPNZjO
div {
v = 4em
height: "calc(%s + 7px)" % v
background: #e53b2c;
}
stylus 文件很難找 ( 特殊字型又很難閱讀 = = 感謝這網友的告知~ https://github.com/stylus/stylus/blob/master/docs/operators.md#sprintf
Sprintf
Multiple values should be parenthesized:
'-webkit-gradient(%s, %s, %s)' % (linear (0 0) (0 100%))
// => -webkit-gradient(linear, 0 0, 0 100%)