roole icon indicating copy to clipboard operation
roole copied to clipboard

Use caniuse data for prefixing

Open curvedmark opened this issue 12 years ago • 2 comments

Inspired by https://github.com/ai/autoprefixer

A few things prevent me to use it directly for Roole:

  • The AST generated by css-parse is incompatible with the one generated by Roole. So we can not directly feed the AST to autoprefixer. This, however, can be fixed by writing a module that translates our AST, though it has a small performance penalty.

  • css-parse doesn't parse selectors, and autoprefixer prefixes selectors simply by searching strings, so it can fail in cases like:

    [title=':fullscreen'] { margin: 0 }
    
  • The ability to target browsers provided by autoprefixer is 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.

curvedmark avatar Oct 16 '13 04:10 curvedmark

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 avatar Dec 18 '13 18:12 narqo

@narqo :+1:

arikon avatar Mar 21 '14 10:03 arikon