无法使用Grunt编译Bootstrap 3 LESS主文件(bootstrap.less)?

时间:2014-02-23 13:05:10

标签: node.js twitter-bootstrap twitter-bootstrap-3 less gruntjs

我无法将“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的新手,也许我错过了什么。

1 个答案:

答案 0 :(得分:3)

也许你的less版本已经过时了? :extend()是Less。

的新功能