【问题标题】:Compile error with escaped string in dotless with VS Web Essentials 2012使用 VS Web Essentials 2012 在 dotless 中使用转义字符串编译错误
【发布时间】:2015-02-24 19:00:38
【问题描述】:

我们有一些我认为来自 .less 版本的 Bootstrap 的代码,在使用 Web Essentials 的 VS2012 中保存/构建时无法编译:

.spanX (@index) when (@index > 0) {
    ~"input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index}" { .span(@index); }
    .spanX(@index - 1);
}

如果我们使用 System.Web.Optimization 中的 LessBundle 编译它会很好,但我们正在尝试将 Less 提前编译为 CSS。有谁知道如何使用 Web Essentials 进行这项工作?

【问题讨论】:

    标签: visual-studio-2012 web-essentials dotless


    【解决方案1】:

    IIRC,Web Essentials 使用 less.js 进行编译。 Less.js 似乎没有将您的示例识别为有效的 LESS。如果您从选择器周围删除~"",less.js 会识别输入,因此请尝试这样做:

    .spanX (@index) when (@index > 0) {
        input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index} { 
            .span(@index); 
        }
        .spanX(@index - 1);
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多