-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Variable calculations inside calc()
not calculated.
#3221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Closing as duplicate of #3191. |
So, I slightly misunderstood this, but it's working as expected. Essentially, the calc() bug was recently fixed and no math is performed within Meaning, you can hack 2.x behavior with: .one {
width: calc(100% - (min(@a + @b)));
} But there's no need, since the calculated result is the same. |
So the v2.7 output was incorrect? If so, what's the expectation for this? @bar: 10px;
@baz: 10px;
.foo {
@_calculation: (@bar + @baz);
width: calc(100% - @_calculation);
} |
The above will/should produce .foo {
width: calc(100% - 20px);
} In other words, variables can be evaluated in |
@calvinjuarez @px-offset: 10px;
@vh-offset: 10vh;
width: calc(100vh - (@px-offset + @vh-offset)); The The whole idea of |
Aight, I can dig that.
Unfortunately that's not what's output at the moment. I created a new issue for that one (#3235). |
@matthew-dean I'm troubled by the lack of evaluation even for negative variables, as that's not really something that can be properly handled at the moment. If we have a simple
the resultant output is
It would seem to me that LESS should handle signage flips as part of the variable insertion. |
Test Case
Expected Output (& Output for v2.7.1)
Actual Output (lessc v 3.0.4)
(Command:
lessc -sm=on test.less > test.css
)The text was updated successfully, but these errors were encountered: