在WinLess上编译twitterbootstrap buttons.less时出错

时间:2012-07-01 20:14:24

标签: twitter-bootstrap less

我在按钮上的WinLess上得到'eval'为null或不是对象。

任何人?

PS。我使用了所有内容的最新版本并导入变量/ mixins

我使用的版本是: WinLess 1.5.3 少1.3 Bootstrap 2.04

修改

这在Bootstrap 2.1.1中已得到修复

2 个答案:

答案 0 :(得分:4)

Twitter引导团队states,他们不保证像button.less这样编辑单个文件。他们鼓励编译bootstrap.less,它具有所有必需的依赖项。否则你必须确保你拥有button.less所需的所有依赖项(通常是mixins.less和variables.less)。

实际上这个问题似乎与WinLess中的一些解析问题有关,所以在修复之前,你可以遇到一个hack,它会欺骗WinLess解析器。在mixins.less中,更改:

// IE7 inline-block
// ----------------
.ie7-inline-block() {
  *display: inline; /* IE7 inline-block hack */
  *zoom: 1;
}

with:

// IE7 inline-block
// ----------------
.ie7-inline-block() {
  *display: inline; /* IE7 inline-block hack */
  *zoom: 1;
  // comment to make it work with WinLESS
}

正如您所看到的那样,它包含向 // comment to make it work with WinLESS 添加新行以欺骗WinLess解析器并使其正常工作!

答案 1 :(得分:0)

还有另外一项工作。

删除<。p>中button.less中的评论

    .btn {
  display: inline-block;
  .ie7-inline-block();
  padding: 4px 10px 4px;
  margin-bottom: 0; // For input.btn
  font-size: @baseFontSize;
  line-height: @baseLineHeight;
  *line-height: 20px;
  color: @grayDark;
  text-align: center;
  text-shadow: 0 1px 1px rgba(255,255,255,.75);
  vertical-align: middle;
  cursor: pointer;
  .buttonBackground(@btnBackground, @btnBackgroundHighlight);
  border: 1px solid @btnBorder;
  *border: 0; **// Remove the border to prevent IE7's black border on input:focus  [remove this]**
  border-bottom-color: darken(@btnBorder, 10%);
  .border-radius(4px);
  .ie7-restore-left-whitespace(); **// Give IE7 some love [remove this]**
  .box-shadow(~"inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)");
}
相关问题