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

Postcss8 loader error on svg core styles.css #341

Closed
K-zimm opened this issue Jan 17, 2022 · 8 comments
Closed

Postcss8 loader error on svg core styles.css #341

K-zimm opened this issue Jan 17, 2022 · 8 comments

Comments

@K-zimm
Copy link

K-zimm commented Jan 17, 2022

Running in nuxt with postcss8.

It is having trouble with one particular line. When I commend it out build completes fine and app works great. Seems that it doesn't like the calc() function on line 202 of styles.css in fontawesome-svg-core The parser cries about the -1.

image

@robmadole
Copy link
Member

@K-zimm can you provide a reproducible test case for this?

@tobiasdiez
Copy link

I got the same issue while upgrading fontawesome-svg-core from 1.2.36 to 1.3.0 JabRef/JabRefOnline#837.
As @K-zimm says, the problem is in the line for left:

.fa-li {
  left: calc(var(--fa-li-width, 2em) * -1);
  position: absolute;
  text-align: center;
  width: var(--fa-li-width, 2em);
  line-height: inherit; }

@JSAustin
Copy link

I also get the same issue. Having a lot of trouble getting past this.

@robmadole
Copy link
Member

That's syntactically correct as far as I know (multiplying by -1). Have you reached out to the postcss folks on this?

@jsayer101
Copy link

jsayer101 commented Mar 8, 2022

@K-zimm Hi ! We've got the same error here, how did you solved this issue ? We got no clue how to fix this.

@tobiasdiez
Copy link

I did a bit of digging and it seems like postcss-values-parser has/had troubles with the multiplication operator in combination with -1, see eg shellscape/postcss-values-parser#126 and shellscape/postcss-values-parser#138. As the latter issue is already closed, one solution might be to upgrade postcss-values-parser.

I guess usually postcss-values-parser is invoked by postcss-custom-properties. More recent version of postcss-custom-properties however directly use postcss-value-parser (without s) instead of ``postcss-values-parser(with s). Thus upgradingpostcss-custom-properties` should fix this issue as well. However, some frameworks like nuxt still use a rather old version of these postcss plugins (there is the stalled nuxt/nuxt#10060 to upgrade these).

@tobiasdiez
Copy link

That being said, what worked for me was to replace the offending line in styles.css with

left: calc(-1 * var(--fa-li-width, 2em));

(i.e. move the minus 1 multiplication to the front).

@robmadole
Copy link
Member

I'm going to close this as it's not a bug with this library.

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

5 participants