【发布时间】:2014-03-07 12:16:36
【问题描述】:
我正在编写一个网络应用程序,并希望将一些 css @media 查询连接到 Bootstrap 中的变量。所以我下载了 bootstrap 并决定让我的 grunt 编译它,当它编译我自己的 less 文件时。
我的 Gruntfile 的相关部分如下所示
less: {
dev: {
options:{
paths: ['app/stylesheets', 'app/stylesheets/bootstrap'], // All the `less` files from bootstrap are placed in 'app/stylesheets/bootstrap' //
},
files: {
'build/pretty/style.css':'app/stylesheets/**/*.less'
}
}
}
但是当我运行 grunt grunt less:dev 它失败并输出
Running "less:dev" (less) task
>> NameError: variable @alert-padding is undefined in app/stylesheets/bootstrap/alerts.less on line 10, column 12:
>> 9 .alert {
>> 10 padding: @alert-padding;
>> 11 margin-bottom: @line-height-computed;
Warning: Error compiling app/stylesheets/bootstrap/alerts.less Use --force to continue.
Aborted due to warnings.
我想尽了办法,
【问题讨论】:
标签: css twitter-bootstrap less gruntjs