Releases: postcss/postcss
2.2.6
2.2.5
- Fix source map with BOM marker support (by @MohammadYounes).
- Fix source map paths (by @MohammadYounes).
2.2.4
2.2.3
2.2.2
2.2.1
2.2 “Marquis Cimeies”
This release adds Node#replace()
shortcut and uses GNU style for syntax error messages.
Replace Nodes
@jonathanong suggested good shortcut to replace one node to another (or several other nodes). For example, you can write @import
loader:
css.eachAtRule(function (rule) {
if ( rule.name != 'import' ) return;
var file = readFileFromRule(rule);
var content = fs.readFileSync(file);
var root = postcss.parse(content, { from: file });
rule.replace(root);
});
GNU Style for Syntax Errors
Old PostCSS’s errors was like Can't parse CSS: Unexpected { in decls at line 2:1 in a.css
.
But GNU Coding Standards had good recommendations for syntax error messages. Rework, CoffeeScript and other tools already use it. Also some tools can find this format in output and they will open your text editor on this line.
PostCSS 2.2 now uses GNU style for syntax errors:
a.css:2:1 Unexpected { in decls
Also CssSyntaxError
now has reason
property to build your own error messages in end-user interfaces (in previous example it will be "Unexpected { in decls"
).
PostCSS Organization
PostCSS repository was moved to postcss GitHub organiztion, which will host official plugins.
2.1.2
2.1.1
2.1 “King Amdusias”
PostCSS 2.1 has new ES6 compiler and show syntax error source.
ES6 Transpiler
PostCSS 2.0 used Traceur to compile ES6 sources to pure JS. Traceur is very powerful, but require to add special runtime JS file to build. Runtime was very big, had side effects and some problems in Browserify and Rhino.
New PostCSS 2.1 uses ES6 Transpiler. It hasn’t runtime, doesn’t change system classes and very small and easy to use. Also it has line-to-line input/output mapping to make debug easier.
Source Line in Syntax Error
By @jonathanong idea CSS syntax error messages now include broken source line:
> postcss.parse('a {\n b { }\n}')
Can't parse CSS: Unexpected { in decls at line 2:5
a {
b { }
^
}
PostCSS will try to detect environment and use colors in error output if they are supported.
Logo
And now PostCSS has own logo. It is alchemist symbol of philosopher’s stone, which can process lead into gold.