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

Cannot handle nested calc()? #49

Closed
assembledadam opened this issue Oct 2, 2018 · 3 comments
Closed

Cannot handle nested calc()? #49

assembledadam opened this issue Oct 2, 2018 · 3 comments

Comments

@assembledadam
Copy link

Using reduce-css-calc via cssnano via optimize-cssnano-plugin.

The input CSS I believe is coming from Bootstrap 4, possibly this line, but it's hard to pinpoint based on the error.

height: calc(calc(2.25rem + 2px) - 1px * 2);

Getting:

 ERROR  Error: CSS minification error: Parse error on line 1:
 auto - 1px * 2
              ^
Expecting 'SUB', 'LPAREN', 'NESTED_CALC', 'NUMBER', 'CSS_VAR', 'LENGTH', 'ANGLE', 'TIME', 'FREQ', 'RES', 'EMS', 'EXS', 'CHS', 'REMS', 'VHS', 'VWS', 'VMINS', 'VMAXS', 'PERCENTAGE', got 'PREFIX'. File: css/app.a46e10bb.css
Error: CSS minification error: Parse error on line 1:
auto - 1px * 2
^
Expecting 'SUB', 'LPAREN', 'NESTED_CALC', 'NUMBER', 'CSS_VAR', 'LENGTH', 'ANGLE', 'TIME', 'FREQ', 'RES', 'EMS', 'EXS', 'CHS', 'REMS', 'VHS', 'VWS', 'VMINS', 'VMAXS', 'PERCENTAGE', got 'PREFIX'. File: css/app.a46e10bb.css
    at /develop/node_modules/@intervolga/optimize-cssnano-plugin/index.js:106:21
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build-prod: `vue-cli-service build && /bin/bash build/prod-server-replace-vars.sh`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build-prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-10-02T18_06_56_983Z-debug.log

Any ideas?

@andyjansson
Copy link
Contributor

The issue lies with this commit: de1338d The grammar in this change is wrong.

@assembledadam
Copy link
Author

Sounds fairly straightforward, but unfortunately my Yacc is more than a little rusty...

@Semigradsky
Copy link
Collaborator

Semigradsky commented Jan 10, 2019

@assembledadam I can't reproduce it on last version: https://repl.it/@Semigradsky/reduce-css-calc49

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

3 participants