Skip to content
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

Fixes #3235 #3237

Merged
merged 1 commit into from Jun 30, 2018
Merged

Fixes #3235 #3237

merged 1 commit into from Jun 30, 2018

Conversation

matthew-dean
Copy link
Member

@matthew-dean matthew-dean commented Jun 27, 2018

Fixes #3235 - Vars storing calculations don't crunch the calculation if the var is used in calc.

The solution here is a bit of a hack, but it shouldn't affect performance. Basically, if we're "inside" a calc() (in the evaluation stage), it wraps any vars during evaluation as a function call. This switches the math back on in the Call Node, and evaluates all the arguments to the call node before merging the value into calc().

Copy link
Member

@calvinjuarez calvinjuarez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix on this one!

.no-math {
@c: 10px + 20px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this with --strict-math=on?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

N/m just tested and seeing it work as intended.

@matthew-dean matthew-dean merged commit f1a3a25 into less:master Jun 30, 2018
@matthew-dean
Copy link
Member Author

@calvinjuarez Thanks for reviewing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants