LessCompiler: Explicitly set strictMath:false for Less.php #217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In Less.js 1.x-3.x the default was strictMath:false, which means math is eagerly evaluated, instead of only "strictly" between parenthesis.
This has the downside of interpreting "/" slashes in newer CSS syntax as Less division, instead of as separator between values in those CSS features (aspect-ratio, border-radius, font).
As such, Less.js 4.x, and Less.php 5.x, renamed "strictMath" to "math", with a new third option "parens-division" as the default, alongside "always" (aka strictMath:false) and "parens" (aka strictMath:true). This option means math is still eagerly evaluated in most cases (plus, minus, multiply, etc) but no longer for division. I don't know if or when the Winter ecosystem wants to adopt this new default, but for now, to minimise disruption and unblock the Less.php upgrade, I suggest simply setting
strictMath: falseexplicitly so that when someone installs Less.php 5.x, they get the same behavior as before.This decouples the trivial Less.php upgrade from the (potentially non-trivial, or unwanted) math migration.
Ref https://phabricator.wikimedia.org/T366445.
Ref https://github.com/wikimedia/less.php/blob/master/CHANGES.md.
See also: