Less v2 does not compile Twitter's Bootstrap 2.x

前端 未结 5 2112
挽巷
挽巷 2020-12-05 17:30

When compiling Twitter\'s Bootstrap 2.3.2. with Less 2 i found to following error:

NameError: #grid > .core > .span is undefined in /home/bootstrap-2.3         


        
5条回答
  •  长情又很酷
    2020-12-05 17:54

    Here's a patch that should do it for v2.0.3 of bootstrap and lessc 3.10.3:

    --- a/bootstrap/less/mixins.less
    +++ b/bootstrap/less/mixins.less
    @@ -530,16 +530,16 @@
     // The Grid
     #grid {
    
    -  .core (@gridColumnWidth, @gridGutterWidth) {
    +  .core (@gridColumnWidth: @gridColumnWidth, @gridGutterWidth: @gutterColumnWidth) {
    
         .spanX (@index) when (@index > 0) {
    -      (~".span@{index}") { .span(@index); }
    +      .span@{index} { .span(@index); }
           .spanX(@index - 1);
         }
         .spanX (0) {}
    
         .offsetX (@index) when (@index > 0) {
    -      (~".offset@{index}") { .offset(@index); }
    +      .offset@{index} { .offset(@index); }
           .offsetX(@index - 1);
         }
         .offsetX (0) {}
    @@ -576,7 +576,7 @@
       .fluid (@fluidGridColumnWidth, @fluidGridGutterWidth) {
    
         .spanX (@index) when (@index > 0) {
    -      (~".span@{index}") { .span(@index); }
    +      .span@{index} { .span(@index); }
           .spanX(@index - 1);
         }
         .spanX (0) {}
    @@ -608,7 +608,7 @@
       .input(@gridColumnWidth, @gridGutterWidth) {
    
         .spanX (@index) when (@index > 0) {
    -      (~"input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index}") { .span(@index); }
    +      input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index} { .span(@index); }
           .spanX(@index - 1);
         }
         .spanX (0) {}
    

提交回复
热议问题