protected function getParser(CacheInterface $cache = null, $pluginOptions = [], $parserOptions = [])
 {
     $parser = new Parser($parserOptions, $cache);
     $pluginOptions['postcss_bin'] = POSTCSS_BIN;
     $parser->getPluginManager()->addPlugin(new AutoprefixPlugin($pluginOptions));
     return $parser;
 }
 /**
  * @inheritdoc
  */
 public function install(Parser $parser)
 {
     $parser->getPluginManager()->addPostProcessor(new AutoprefixProcessor($this->getOptions()));
 }
Ejemplo n.º 3
0
    public function testVisitorPlugin()
    {
        $parser = new Parser();
        $parser->getPluginManager()->addPlugin(new myTest3Plugin());
        // we fake the path as base dir for the file
        $parser->parseString('body { background: url("data/image.svg"); }', __DIR__ . '/_fixtures/less.js/string.less');
        $css = $parser->getCSS();
        $expected = <<<CSS
body {
  background: url("data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%0A%3Csvg%20height%3D%22100%22%20width%3D%22100%22%3E%0A%20%20%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2240%22%20stroke%3D%22black%22%20stroke-width%3D%221%22%20fill%3D%22blue%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");
}

CSS;
        $this->assertEquals($expected, $css, 'The visitor did something');
    }
 protected function getParser(CacheInterface $cache = null)
 {
     $parser = new Parser([], $cache);
     $parser->getPluginManager()->addPlugin(new Plugin(['foo' => __DIR__ . '/_fixtures/custom_import', 'some-vendor-library-path' => __DIR__ . '/_fixtures/vendor']));
     return $parser;
 }