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

Unwanted LESS calculations applied on CSS properties with "arithmetic-like" values #32

Closed
AFaust opened this issue Feb 9, 2017 · 4 comments
Assignees
Labels

Comments

@AFaust
Copy link

AFaust commented Feb 9, 2017

When integrating JLessC as an alternative to LESS engine in the Share client of Alfresco ECM I encountered an instance where JLessC incorrectly evaluated a valid CSS property value as an arithmetic operation. This problem has affected less.js in the past (i.e. #146) as well.

The CSS specifications define some properties to allow for value expressions that look like arithmetic operations but should not be treated / evaluated as such. This affects e.g. the font or border-radius properties. In my case I have a vendor provided CSS rule

.@{alfresco}
{
   font:13px/1.231 Open Sans,arial,helvetica,clean,sans-serif;
}

that is processed by JLessC to

.alfresco-share {
  font: 10.5605199px Open Sans, arial, helvetica, clean, sans-serif;
}
@Horcrux7 Horcrux7 added the bug label Feb 10, 2017
@Horcrux7 Horcrux7 self-assigned this Feb 10, 2017
@Horcrux7
Copy link
Member

Horcrux7 commented Feb 11, 2017

Do you need a strict math operation?

  -sm=on|off               Turns on or off strict math, where in strict mode, math.
  --strict-math=on|off     Requires brackets. This option may default to on and then
                           be removed in the future.

Or is the default or is the default lessc behavior ok for you? The default behavior handle the problem of the "font" property but not of the "border-radius" property.

@Horcrux7
Copy link
Member

Please try the snapshot if this solve your problems.

@AFaust
Copy link
Author

AFaust commented Feb 12, 2017

Yes - with the snapshot the font property is handled correctly in my case and luckily there is no use of border-radius in the "problematic" way within the default styles.

@Horcrux7
Copy link
Member

The fix for your problem has produce a regression. I have rewrite it. Please try again the snapshot version if it work continue for you. Thanks.

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

No branches or pull requests

2 participants