Use caniuse data for prefixing
Inspired by https://github.com/ai/autoprefixer
A few things prevent me to use it directly for Roole:
-
The AST generated by
css-parseis incompatible with the one generated by Roole. So we can not directly feed the AST toautoprefixer. This, however, can be fixed by writing a module that translates our AST, though it has a small performance penalty. -
css-parsedoesn't parse selectors, andautoprefixerprefixes selectors simply by searching strings, so it can fail in cases like:[title=':fullscreen'] { margin: 0 } -
The ability to target browsers provided by
autoprefixeris too powerful, that it needs to include huge amount of browser version data in its standalone file. We can strike a balance here to pre-select a reasonable browser support range, and just include the prefixes data. User can only choose which vendors they want to target.
Maybe you could extend current plugins API with more events. So, for example, somebody may write some sort of plugin to use autoprefixer as post-processing tool. Something like this:
var autoprefixer = require('autoprefixer'),
roole = require('roole');
roole.use(funtion(roole) {
roole.on('end', function(css, options) {
return autoprefixer(options).compile(css);
});
});
@narqo :+1: