SquishIt在使用Bootstrap _时生成空文件: - form.less

时间:2016-03-31 19:23:10

标签: twitter-bootstrap squishit

作为前驱,你应该知道我目前没有选择引用另一个版本的Bootstrap或使用CDN版本的缩小Bootstrap。

在我的场景中,我们自己的LESS文件引用了来自Bootstrap的LESS文件。最近,在尝试使用SquishIt生成CSS的压缩版本时,我注意到输出文件完全是空的。

我将违规部分追溯到Bootstrap的表格。没有,特别是这些IE11黑客:

// IE 11 hack to reverse the iOS temporal input hack.
_:-ms-fullscreen, :root input[type="date"],
_:-ms-fullscreen, :root input[type="time"],
_:-ms-fullscreen, :root input[type="datetime-local"],
_:-ms-fullscreen, :root input[type="month"] {
  line-height: @line-height-base;

  &.input-sm {
    line-height: @line-height-small;
  }
  &.input-lg {
    line-height: @line-height-large;
  }
}

有人知道为什么这个特殊的块会生成破坏压缩并导致输出空文件的CSS吗?它是下划线选择器吗?评论出这个LESS部分可以解决它并且所有内容都很好,但这似乎不是正确的解决方法。

另外值得注意的是,我在Visual Studio 2013中使用Web Essentials 2013来进行CSS编译,而WE2013在IDE中告诉我,下划线选择器是一个无效的选择器。不确定这是否限制从LESS产生不正确的CSS?

1 个答案:

答案 0 :(得分:1)

我对网络必需品知之甚少。你看过SquishIt.Less吗?它可能使用更新的dotless版本。

如果它没有无点,我怀疑是一个缩小器问题。如果是这种情况,切换到YUI可能会有所帮助。可以使用global.asax.cs

中的以下内容执行此操作

Bundle.ConfigureDefaults().UseYuiForCssMinification()