Closed dumistoklus closed 3 years ago
In example below I got an error after using postcss-csso plugin:
1.scss
.c { .touch &:hover { color: red; } }
csso.js
const postcss = require('postcss'); const nested = require('postcss-nested'); const csso = require('postcss-csso'); const fs = require('fs'); fs.readFile('1.scss', (err, css) => { postcss([ nested(), csso(), ]) .process(css, {from: '1.scss', to: 'result.css'}) .then(result => { fs.writeFile('result.css', result.css, () => true) }); });
in result
SyntaxError: Unexpected input at Object.error (\node_modules\←[4mcss-tree←[24m\lib\parser\create.js:240:19) at \node_modules\←[4mcss-tree←[24m\lib\parser\create.js:299:20 at parseToCsso (\node_modules\←[4mpostcss-csso←[24m\lib\postcssToCsso.js:16:26) at postcssToCsso (\node_modules\←[4mpostcss-csso←[24m\lib\postcssToCsso.js:40:26) at Array.map (<anonymous>) at appendChildren (\node_modules\←[4mpostcss-csso←[24m\lib\postcssToCsso.js:10:39) at postcssToCsso (\node_modules\←[4mpostcss-csso←[24m\lib\postcssToCsso.js:41:24) at Array.map (<anonymous>) { source: ←[32m'.touch &:hover'←[39m, offset: ←[33m7←[39m, line: ←[33m1←[39m, column: ←[33m8←[39m, sourceFragment: ←[36m[Function (anonymous)]←[39m, parseError: { offset: ←[33m7←[39m, line: ←[33m1←[39m, column: ←[33m8←[39m } }
But without ccso in plugin list, I got correctly compliled file:
result.css
.touch .c:hover { color: red; }
Hi, my PR (#18) fixes this issue. @lahmatiy can you have a look please ?
@lahmatiy Have some news?
Fix published in 5.0.1
In example below I got an error after using postcss-csso plugin:
1.scss
csso.js
in result
But without ccso in plugin list, I got correctly compliled file:
result.css