rplus.github.io icon indicating copy to clipboard operation
rplus.github.io copied to clipboard

[POST] Use a Stylus variable inside `calc()`

Open Rplus opened this issue 10 years ago • 0 comments

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%)

Rplus avatar Mar 19 '16 21:03 Rplus