> ParseErr-6ren">
gpt4 book ai didi

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

转载 作者:搜寻专家 更新时间:2023-11-01 00:44:54 24 4
gpt4 key购买 nike

我无法编译“主要”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 的新手,也许我遗漏了什么。

最佳答案

也许您的 less 版本已过时? :extend() 是 Less 的一个新特性。

关于node.js - 无法使用 Grunt 编译 Bootstrap 3 LESS 主文件 (bootstrap.less)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21968601/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com