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

ng-packagr overrides less.js math default behaviour in unexpected way #2675

Closed
Maistho opened this issue Aug 18, 2023 · 2 comments · Fixed by #2678
Closed

ng-packagr overrides less.js math default behaviour in unexpected way #2675

Maistho opened this issue Aug 18, 2023 · 2 comments · Fixed by #2678
Labels

Comments

@Maistho
Copy link

Maistho commented Aug 18, 2023

Type of Issue

[x] Bug Report
[ ] Feature Request

Description

ng-packagr overrides the default less settings with math: 'always' which results in expressions being evaluated as math when they shouldn't be.

How To Reproduce

A less file with the following contents should not be changed when compiling with the default settings in less 4.x:

.test {
  grid-row: 1 / 2;
}

When compiling this for an application using the default settings in angular cli, this css is output verbatim. When compiling this for a library using the default settings, it is changed to the following:

.test {
  grid-row: 0.5;
}

Expected Behaviour

ng-packagr should not override the default settings in less as it does here: https://github.com/ng-packagr/ng-packagr/blob/7a8f7113027afc67694cb4849eb96d66caf69142/src/lib/styles/stylesheet-processor-worker.ts#L115C18-L115C18

Version Information

$ node_modules/.bin/ng-packagr --version
ng-packagr: 16.0.1
less: 4.1.3
alan-agius4 added a commit that referenced this issue Aug 21, 2023
This change aligns the option with that of the Angular CLI as it caused unexpected output.

Closes #2675
alan-agius4 added a commit that referenced this issue Aug 21, 2023
This change aligns the option with that of the Angular CLI as it caused unexpected output.

Closes #2675
@Maistho
Copy link
Author

Maistho commented Aug 23, 2023

Thanks!

@github-actions
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

This action has been performed automatically by a bot.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

2 participants