0

尝试少编译时,我缺少NameError: variable @brand-success is undefined in app/static/css/less/style.less on line 131, column 15:. 但是,它是app/bower_components/bootstrap/less/variables.less'app/bower_components/bootstrap/less/bootstrap.less'.

使用grunt-contrib-less和编译时显示:

Running "less:files" (less) task
File app/static/css/icons.css created: 0 B â 175 B
File app/static/css/main.css created: 0 B â 152.44 kB
File app/static/css/modal-large.css created: 0 B â 1.29 kB
>> NameError: variable @brand-success is undefined in app/static/css/less/style.less on line 131, column 15:
>> 130     .circle-green {
>> 131       .circle(@brand-success);
>> 132     }
Warning: Error compiling app/static/css/less/style.less Use --force to continue.

我证实它正在拉动'app/bower_components/bootstrap/less/bootstrap.less',因为我有:

one@node ~/github/lbs/lbs/app/static/css/less $ cat vendor.less 
@import 'app/bower_components/bootstrap/less/bootstrap.less';
@import 'app/bower_components/font-awesome/less/font-awesome.less';
one@node ~/github/lbs/lbs/app/static/css/less $ 

如果我故意改变路径是错误的,它会抱怨。所以,我知道它正在使用 bootstrap.less。

有谁知道这是什么原因造成的?

这是更多信息:

one@node ~/github/lbs/lbs/app/static/css/less $ cat main.less 
// Main less file for your application.
// Use `@import` to use other less files
// relative to 'app/css' or 'vendor/css'.
@import 'vendor';
@import 'modal-large';
@import 'icons';
@import 'style'

one@node ~/github/lbs/lbs $ !grep
grep -il brand-success -R *
app/bower_components/bootstrap/dist/css/bootstrap.css.map
app/bower_components/bootstrap/less/variables.less
app/static/css/less/style.less
one@node ~/github/lbs/lbs $ 
4

1 回答 1

1

我放置@import 'app/bower_components/bootstrap/less/bootstrap';在 style.less 中,它修复了它。但这真的是一个黑客......还有其他问题,如果有人能找出原因,那就太好了。

于 2014-07-25T22:44:37.860 回答