(已经找到以下所有设置信息真是一团糟:-/)
我可以让 autoprefixer 与 docpad 一起运行,但我(我猜我)没有成功设置browsers
值......
我的环境:
- 文档板 6.69.1
- IE 11、FF 31.0 + 萤火虫
到目前为止我尝试过的(使用插件安装 docpad :jade,less,livereload,marked):
简单安装工作(默认browsers
设置):
docpad install autoprefix
我得到了一些style.css.less
文件,其中包含一些导入,尤其是一些background: radial-gradient(...) ; background: linear-gradient(...)
规则。
- 我将我的重命名
style.css.less
为style.css.autoprefix.css.less
(style.css.autoprefix.less
没用)
直到这里,它只在警告less->css
或css->autoprefix
转换没有做任何应该没问题的事情的情况下工作。
autoprefixer 在上面添加了一些-webkit...
我的...gradient...
规则版本。
browsers
没有 docpad 手写笔插件就无法设置?
......在我看来......所以我继续这样:
docpad install stylus
将 autoprefixer stylus 设置添加到我的
docpad.coffee
设置文件中:docpadConfig = { #... plugins: stylus: stylusLibraries: 'autoprefixer-stylus': true options: use: [ #() -> require('autoprefixer-stylus')('ie 6') () -> require('autoprefixer-stylus')('ff > 3') #() -> require('autoprefixer-stylus')('last 2 versions') ] } # Export our DocPad Configuration module.exports = docpadConfig
效果是,现在 mystyle.css
显然又是自动前缀了,但是在上面的选项之间切换没有效果。
如何browsers
从这里进行设置?
我从不同来源收集到的所有设置信息,所以我可能错过了一些东西。也许已经可以在没有手写笔插件的情况下配置browsers
设置?
这里或多或少帮助我达到这一点的来源:
- https://www.npmjs.com/package/docpad-plugin-autoprefix
- https://www.npmjs.com/package/autoprefixer
- https://www.npmjs.com/package/docpad-plugin-stylus
- https://www.npmjs.com/package/autoprefixer-stylus
- http://blog.sapegin.me/all/css-workflow
- https://github.com/kizu/docpad-test/blob/master/docpad.coffee
我的主要测试用例
在我的 css 中手动添加附加-moz-radial-gradient...
/规则会显示正确的渐变。-moz-linear-gradient...
删除它们不会显示任何渐变(甚至不显示标准语法并且独立于使用自动前缀...这可能是一个无关/遗留问题,因为我希望更复杂的style.css可以更改上述browsers
选项至少逐渐改变。)