我使用composer安装了“autoPrefixer PHP”并尝试了github页面( https://github.com/vladkens/autoprefixer-php)中显示的示例。非常简单的例子
$autoprefixer = new Autoprefixer();
$css = 'a { transition: transform 1s }';
$prefixed = $autoprefixer->compile($css);
只是输出 $css 不变。但是,如果我使用自定义参数初始化 autprefixer 对象,它会输出正确的前缀 css。
$autoprefixer = new Autoprefixer('last 2 versions');
还使用示例中所示的参数初始化对象,给出“未知浏览器要求'ie8'”错误
$autoprefixer = new Autoprefixer(array('ff > 2', '> 2%', 'ie8')); // many rules
那么我的安装有什么问题呢?其实我并没有手动做任何事情,只是由composer安装的。