Skip to content
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

Fixed issue with lib-line-height mixin failing when value of 'normal'… #18168

Conversation

CNanninga
Copy link

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

  1. Introduce any LESS, in a theme or module file, that uses the mixin .lib-line-height with a value of "normal."
  2. Compile LESS, whether with Grunt, with browser compilation in developer mode, or via a setup:static-content:deploy.
  3. The following error is thrown during LESS compilation: "SyntaxError: Operation on an invalid type in …"

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.

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Sep 20, 2018

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team
Copy link
Contributor

Hi @CNanninga. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me $VERSION instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-engcom-team
Copy link
Contributor

@CNanninga thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@CNanninga
Copy link
Author

@magento-engcom-team - I followed the link, but didn't get any indication that an action was completed. (Just got redirected to the repository home page.)

@dmanners
Copy link
Contributor

Hi @CNanninga I can see next to your name it now says 'Member' which is what the link should setup so it looks to have worked fine.

@magento-engcom-team magento-engcom-team merged commit 09ce6c9 into magento:2.2-develop Oct 2, 2018
magento-engcom-team pushed a commit that referenced this pull request Oct 2, 2018
@magento-engcom-team
Copy link
Contributor

Hi @CNanninga. Thank you for your contribution.
We will aim to release these changes as part of 2.2.8.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants