我无法将“main”bootstrap.less
编译成'<%= pkg.name %>.css'
。运行grunt less
时出现此错误:
Running "less:dist" (less) task
>> ParseError: Syntax Error on line 643 in bower_components\bootstrap\less\mixins.less:643:25
>> padding-right: (@grid-gutter-width / 2);
>> &:extend(.clearfix all);
>> }
Warning: Error compiling LESS. Use --force to continue.
Aborted due to warnings.
我对less
任务的配置非常简单:
less: {
options: {
strictMath: true
},
dist: {
files: {
'dist/assets/css/<%= pkg.name %>.css': [
'<%= bootstrap_less %>/bootstrap.less',
'src/assets/less/style.less'
]
}
}
},
// Arbitrary properties used in task configuration templates.
bower_components: 'bower_components',
bootstrap_less: '<%= bower_components %>/bootstrap/less'
mixins.less
中的错误行(我没有以任何方式修改):
// Centered container element
.container-fixed() {
margin-right: auto;
margin-left: auto;
padding-left: (@grid-gutter-width / 2);
padding-right: (@grid-gutter-width / 2);
&:extend(.clearfix all);
}
请不要我是Grunt的新手,也许我错过了什么。
答案 0 :(得分:3)
也许你的less
版本已经过时了? :extend()
是Less。