如何使用LESS的bootstrap mixin?

时间:2015-09-22 11:38:20

标签: twitter-bootstrap-3 less less-mixins

我正在准备页面布局并且必须使用Bootstrap 3.我有一个带渐变的按钮,所以我想使用Bootstrap mixin #gradient.horizontal

background: #gradient.horizontal(@color-start,@color-end,0%,100%);

但是在运行编译任务时出现了解析错误:

[13:21:24] { type: 'Parse',
filename: 'path_to_file.less',
index: 535,
line: 23,
callLine: NaN,
callExtract: undefined,
column: 18,
extract: 
  [ '      display: block;',
    '      background: #gradient.horizontal(@color-start,@color-end,0%,100%);',
    '      box-shadow: 0 3px 10px -5px rgba(0, 0, 0, 1);' ],
message: 'Unrecognised input in file path_to_file.less line no. 23',
stack: undefined,
lineNumber: 23,
fileName: 'path_to_file.less',
name: 'Error',
showStack: false,
showProperties: true,
plugin: 'gulp-less',
__safety: { toString: [Function] } }

我使用bootstrap-less v:3.3.8并在main.less文件中导入整个bootstrap @import "bootstrap/index";

我很感激任何提示如何解决它

1 个答案:

答案 0 :(得分:1)

好的,我发现了......抱歉一塌糊涂

应该是:

#gradient.horizontal(@color-start,@color-end,0%,100%);

没有背景: