-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
More concise improvements for add()
and subtract()
#34432
Conversation
@ffoodd I'm afraid that's not right. The second argument of substract should be put in brackets always when it's a complex expression (not type-of number), whatever sign it contains. Simple match: b = 10 + 1 = 11 b = 10 - 1 = 9 The results of your last two tests: font-size: subtract(1vw, $add); = font-size: calc(1vw - (1rem + 1em));
font-size: subtract(1vw, $subtract); = font-size: calc(1vw - 1rem - 1em); are mathematically equal, though obviously the should not be. |
24784ae
to
4d19246
Compare
Just updated the PR and made another SassMeister. Should be better :) |
@ffoodd This version seams to be working fine (mathematically correct). |
Just to confirm @ffoodd did you check the dist file changes? Does everything look good now? |
@XhmikosR Yes, we only had 5 occurrences of unneeded parenthesis ( |
add()
and subtract()
Better fix for #33953, improves #34047
@oliwerAR Back to this, made a quick SassMeister to play with.
From my understanding, brackets are required on
subtract()
second argument only when it contains an addition, am I right? Thinking so, I also checked that second argument contains a+
sign to only output brackets when necessary.