Closed claudewowo closed 6 years ago
I'll see what I can do.
There is another case, using the postcss-cssnext plugin before the postcss-units, it will be two units in css, like this:
If using the postcss-units plugin before the postcss-cssnext, u will get error information below:
Module build failed: Error: Parse error on line 1: 700% - rem(90) -------^ Expecting 'SUB', 'LPAREN', 'NESTED_CALC', 'NUMBER', 'CSS_VAR', 'LENGTH', 'ANGLE', 'TIME', 'FREQ', 'RES', 'EMS', 'EXS', 'CHS', 'REMS', 'VHS', 'VWS', 'VMINS', 'VMAXS', 'PERCENTAGE', got 'PREFIX'
It's my config in the postcss.config.js:
module.exports = { plugins: [ require('postcss-import')({ path: ['resources/assets/'] }), require('postcss-assets')({ loadPaths: ['resources/assets/common/'] }), require('postcss-nested'), require('postcss-color-function'), require('postcss-mixins'), require('postcss-extend'), require('postcss-units')({ size: 75, fallback: false, precision: 4 }), require('postcss-cssnext'), require('cssnano')({ sourcemap: true, safe: true, discardComments: { removeAll: false, }, discardUnused: false, zindex: false, }), ] }
I hope you can help me, 3Q~
This case work. Look this test https://github.com/gladkih/postcss-units/blob/master/test.js#L70
css: font-size: calc(700% - rem(90));
error: Module build failed: Error: Parse error on line 1: 700% - rem(90) -------^ Expecting 'SUB', 'LPAREN', 'NESTED_CALC', 'NUMBER', 'CSS_VAR', 'LENGTH', 'ANGLE', 'TIME', 'FREQ', 'RES', 'EMS', 'EXS', 'CHS', 'REMS', 'VHS', 'VWS', 'VMINS', 'VMAXS', 'PERCENTAGE', got 'PREFIX'