问题
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