This MR contains the following updates:
- Fix a bug where Sass variables and function calls in calculations weren't being resolved correctly if there was a parenthesized interpolation elsewhere in the file.
max()expressions are once again parsed as calculations as long as they contain only syntax that's allowed in calculation expressions. To avoid the backwards-compatibility issues that were present in 1.40.0, they now allow unitless numbers to be mixed with numbers with units just like the global
max()functions allow unitless numbers to be mixed with numbers with units.
- Preserve parentheses around
var()functions in calculations, because they could potentially be replaced with sub-expressions that might need to be parenthesized.
Calculation values can now be combined with strings using the
+operator. This was an error in 1.40.0, but this broke stylesheets that were relying on
$value + ""expressions to generically convert values to strings. (Note that the Sass team recommends the use of
inspect($value)for that use-case.)
selector.unify()function now correctly returns
nullwhen one selector is a
:host-contextand the other is a selector that's guaranteed to be within the current shadow DOM. The
@extendlogic has been updated accordingly as well.
Fix a bug where extra whitespace in
calc()expressions could cause bogus parse errors.
Fix a bug where the right-hand operand of a
-in a calculation could incorrectly be stripped of parentheses.
Potentially breaking bug fix:
max()expressions outside of calculations now behave the same way they did in 1.39.2, returning unquoted strings if they contain no Sass-specific features and calling the global
max()functions otherwise. Within calculations, they continue to behave how they did in 1.40.0.
This fixes an unintended breaking change added in 1.40.0, wherein passing a unitless number and a number without units to
max()now produces an error. Since this breakage affects a major Sass library, we're temporarily reverting support for
max()calculations while we work on designing a longer-term fix.
Add support for first-class
calc()expressions (as well as
max()). This means:
calc()expressions will be parsed more thoroughly, and errors will be highlighted where they weren't before. This may break your stylesheets, but only if they were already producing broken CSS.
calc()expressions will be simplified where possible, and may even return numbers if they can be simplified away entirely.
calc()expressions that can't be simplified to numbers return a new data type known as "calculations".
Sass variables and functions can now be used in
meta.calc-args()can now inspect calculations.
Add a new value type,
SassCalculation, that represents calculations.
CalculationInterpolationtypes to represent types of arguments that may exist as part of a calculation.
Add a new
Add a new
If you want to rebase/retry this MR, check this box.
This MR has been generated by Renovate Bot.