[Forwardport] Fixed issue with lib-line-height mixin failing when value of 'normal'… #18394
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.
Original Pull Request
#18168
Description
This fixes an issue with the lib-line-height LESS mixin that results in an error during compilation if a value of "normal" is passed in.
Issue Reproduction Steps
Alternate Reproduction Steps
A common scenario that will cause this is if the mixin .lib-inline-block-space-item is used without parameters, as "normal" is passed in as the default value for @_line-height, which is then passed to .lib-line-height.
Additional Information
This issue became more prominent/likely in 2.2.6, because previously the definition of .lib-inline-block-space-item used a simple "line-height: @_line-height" declaration, whereas now it calls .lib-line-height with the value.
The first definition of .lib-line-height - with the guard "when not (@heightValue = false) and not (ispercentage(@heightValue)" - is the one that is matched if "normal" is passed in. This definition uses the mixin .lib-font-size-value, which does mathematical calculations on the value that are not valid for a value of "normal."
Fix
Placed additional guards on the first definition of .lib-line-height so that it does not match the value of "normal," and added a new definition that matches this value, avoiding the .lib-font-size-value call.