Stylus not allowing basic subtraction

こ雲淡風輕ζ 提交于 2019-12-24 03:24:06

问题


Noticed an issue when using semantic grids stylus.

*width total-width * ((((gutter-width + column-width ) * x) - gutter-width) / _gridsystem-width)-correction

is processing to something along the lines(read different numbers)

  *width: 89.5833333333333% -correction;

So, I decided to performan an experiment. When running stylus -i I found subtraction there was also not operating (at all)

To verify I wrote this in my file

x=10
y=20
.something
    font-size y-x

which process to

.something {
  font-size: y-x;
}

Am I crazy? Did I interpret operators incorrectly with stylus? Pending the results here I may open a ticket on github. I did find another person with an issue around percentages that highlights the - operator not functioning as expected. However, this doesn't seem related to my issue.

Tldr: basic math without units doesn't seem to be working


回答1:


This is a known problem, dash - is counted as a part of a variable name, so when you write -correction, Stylus sees it as a variable -correction.

The obvious fix is to always use spaces around the minus: - correction, this way Stylus would always recognize the operator.



来源:https://stackoverflow.com/questions/23232729/stylus-not-allowing-basic-subtraction

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!