-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix simplification of calc() expressions #3147
Labels
bug
Something isn't working
Comments
nex3
added a commit
that referenced
this issue
Sep 14, 2021
`a - (b - c)` should preserve the parentheses of the right-hand operand, but we weren't doing so. See #3147
nex3
added a commit
that referenced
this issue
Sep 14, 2021
`a - (b - c)` and `a - (b + c)` should preserve the parentheses of the right-hand operand, but we weren't doing so. See #3147
nex3
added a commit
to sass/sass-spec
that referenced
this issue
Sep 14, 2021
nex3
added a commit
to sass/dart-sass
that referenced
this issue
Sep 14, 2021
nex3
added a commit
that referenced
this issue
Sep 14, 2021
`a - (b - c)` and `a - (b + c)` should preserve the parentheses of the right-hand operand, but we weren't doing so. See #3147
nex3
added a commit
to sass/sass-spec
that referenced
this issue
Sep 14, 2021
nex3
added a commit
to sass/dart-sass
that referenced
this issue
Sep 14, 2021
Thanks for the report! |
mirisuzanne
pushed a commit
that referenced
this issue
Feb 10, 2022
`a - (b - c)` and `a - (b + c)` should preserve the parentheses of the right-hand operand, but we weren't doing so. See #3147
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dart Sass 1.40.0 introduced a new feature that simplifies
calc()
expressions. Unfortunately, at least part of that simplification logic seems to yield incorrect results.Example input:
Expected output:
Actual output (as of v1.40.0 – v1.40.1):
Seems like there is missing logic around resolving brackets
()
in the subtrahend (right-hand side of a substraction); here,+
and-
may need to be flipped.For example,
a - (b - c)
can be simplified toa - b + c
, but must not be simplified toa - b - c
.The text was updated successfully, but these errors were encountered: