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

Error compiling calc with negative values at the end #1516

Closed
ilunglee opened this issue Sep 29, 2021 · 1 comment
Closed

Error compiling calc with negative values at the end #1516

ilunglee opened this issue Sep 29, 2021 · 1 comment

Comments

@ilunglee
Copy link

ilunglee commented Sep 29, 2021

Hello there,

I ran into an issue with bootstrap@5.1.1 when compiling with sass@1.42.1. Related to twbs/bootstrap#35011

Here is the compilation error:

Module build failed (from ./node_modules/postcss-loader/src/index.js):
ParserError: Syntax Error at line: 1, column 25

And, here are the lines that cause this issue:

 margin-top: calc(var(--#{$variable-prefix}gutter-y) * -1); // stylelint-disable-line function-disallowed-list 
 margin-right: calc(var(--#{$variable-prefix}gutter-x) * -.5); // stylelint-disable-line function-disallowed-list 
 margin-left: calc(var(--#{$variable-prefix}gutter-x) * -.5); /

The problem seems to be related to the negative values at the end of each line (e.g., -1, -.5). If I change the lines into the following, the compilation error no longer exists:

margin-top: calc(-1 * var(--#{$variable-prefix}gutter-y) * 1); // stylelint-disable-line function-disallowed-list
margin-right: calc(-1 * var(--#{$variable-prefix}gutter-x) * .5); // stylelint-disable-line function-disallowed-list
margin-left: calc(-1 * var(--#{$variable-prefix}gutter-x) * .5); // stylelint-disable-line function-disallowed-list

Thanks in advance for the assistance!

@ilunglee ilunglee changed the title Error compiling calc with negative values Error compiling calc with negative values at the end Sep 29, 2021
@jathak
Copy link
Member

jathak commented Sep 29, 2021

Duplicate of #1496. This is a bug in postcss-values-parser, not Sass.

@jathak jathak closed this as completed Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants