Autoprefixes the generated CSS using PostCSS autoprefixer plugin.
To use this plugin you need node.js > 0.12
installed on the machine.
Install using composer:
$ composer require mishal/iless-plugin-autoprefix
Install requirements
$ npm install postcss-cli autoprefixer
See package.json
for required versions.
use ILess\Parser;
use ILess\Plugin\Autoprefix\AutoprefixPlugin;
$parser = new Parser();
// register the plugin
$parser->getPluginManager()->addPlugin(new AutoprefixPlugin([
// see https://github.com/ai/browserslist
'browsers' => ['last 2 versions']
]));
$parser->parseFile('/example.less');
$css = $parser->getCSS();
a {
display: flex;
}
a {
display: -ms-flexbox;
display: flex;
}