对@品牌成功的抱怨较少是不确定的,即使它在变量中也是如此

时间:2014-07-25 22:17:56

标签: css twitter-bootstrap gruntjs less.js grunt-contrib-less

当尝试编译时,我得到了一个缺失的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 $ ,因为我有:

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'

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

任何人都知道造成这种情况的原因是什么?

以下是更多信息:

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 $ 

{{1}}

1 个答案:

答案 0 :(得分:1)

我将@import 'app/bower_components/bootstrap/less/bootstrap';放在style.less中,修复了它。但这真的是一个黑客......别的东西是错的,如果有人能弄清楚原因,那就太好了。