PostCSS 5.2 contains parser fix and better syntax error output.
Syntax Errors
In previous versions syntax errors were very simple:
@andreypopp did great work and now main webpack’s loaders have same output on syntax error. Unification is good, so we decided to use same output for PostCSS errors too.
First, we added line numbers to code frame. Then we increased lines count. @andreypopp added syntax highlight. And finally @lydell fix output for tab indent and some other edge cases.
So right now PostCSS syntax errors are similar to Babel and webpack errors:
Highlight CSS
PostCSS 5.2 has CSS syntax highlight for syntax error. But you can use our highlighter in your terminal tool too:
const highlight = require('postcss/lib/terminal-highlight');
console.log(highlight('a { color: black }'))
Parser Fixes
PostCSS 5.2 has new [
and ]
tokens to parse [attr=;] { }
correctly.