postcss-pxtorem icon indicating copy to clipboard operation
postcss-pxtorem copied to clipboard

PX doesn't work with cssnano and postcss-calc

Open luksak opened this issue 6 years ago • 3 comments

This is the error I get when using PX to ignore a property:

Message:
    Lexical error on line 1: Unrecognized text.

  Erroneous area:
1: 1PX + 0.3em
^..^
Details:
    hash: [object Object]
    postcssNode: padding:calc(1PX + 0.3em)
    fileName: /sass/styles.css
    domainEmitter: [object Object]
    domain: [object Object]
    domainThrown: false

Stack:
JisonLexerError: Lexical error on line 1: Unrecognized text.

  Erroneous area:
1: 1PX + 0.3em
^..^
    at /sass/styles.css:427:7
    at Object.parseError (/node_modules/postcss-calc/dist/parser.js:1164:15)
    at Object.lexer_parseError [as parseError] (/node_modules/postcss-calc/dist/parser.js:2297:44)
    at Object.lexer_next [as next] (/node_modules/postcss-calc/dist/parser.js:3292:22)
    at Object.lexer_fastLex [as fastLex] (/node_modules/postcss-calc/dist/parser.js:3367:18)
    at fastLex (/node_modules/postcss-calc/dist/parser.js:1567:27)
    at Parser.parse (/node_modules/postcss-calc/dist/parser.js:1641:30)
    at /node_modules/postcss-calc/dist/lib/transform.js:30:30
    at walk (/node_modules/postcss-value-parser/lib/walk.js:19:7)
    at ValueParser.walk (/node_modules/postcss-value-parser/lib/index.js:18:3)
    at transformValue (/node_modules/postcss-calc/dist/lib/transform.js:24:50)
    at _default (/node_modules/postcss-calc/dist/lib/transform.js:59:100)
    at /node_modules/postcss-calc/dist/index.js:25:51
    at /node_modules/postcss/lib/container.js:135:18
    at Rule.each (/node_modules/postcss/lib/container.js:101:16)
    at Rule.walk (/node_modules/postcss/lib/container.js:131:17)
    at /node_modules/postcss/lib/container.js:148:24```

luksak avatar Nov 30 '18 13:11 luksak

解决了吗???我也碰到这个问题了。打包出错,报语法错误

y1324 avatar Nov 13 '19 03:11 y1324

I have the same problem, currently using the selectorBlackList to filter

xxssww0258 avatar May 29 '20 09:05 xxssww0258

What if you tried running this plugin before running CSS nano?

cuth avatar May 29 '20 10:05 cuth