2013-03-07 73 views
0

我已经实现与Semantic.gs和一些嵌套列的流动布局事半功倍。但是现在我们的客户决定他们希望布局得到修复。使用Semantic.gs嵌套列固定布局

我想我可以简单地注释掉@总宽度:在grid.less 100%,但是现在其他LESS文件给出一个错误上与.row()混入线。

是否有解决方法?

这里是grid.less

///////////////// 
// Semantic.gs // for LESS: http://lesscss.org/ 
///////////////// 

// Defaults which you can freely override 
@column-width: 20; 
@gutter-width: 10; 
@columns: 47; 


// Utility variable - you should never need to modify this 
@gridsystem-width: (@column-width*@columns) + (@gutter-width*@columns) * 1px; 
// Set @total-width to 100% for a fluid layout 
//@total-width: @gridsystem-width; 
//@total-width: 100%; 
// Uncomment these two lines and the star-hack width/margin lines below to enable sub-pixel fix for IE6 & 7. See http://tylertate.com/blog/2012/01/05/subpixel-rounding.html 
@min-width: 980; 
@correction: 1/@min-width * 100 * 1.5%; 

的相关部分这里是LESS文件的有问题的部分。少编译器给出了错误“编译器错误 变量@总宽度是不确定的(线:292)”,这是与.row()属性行:

#v_main_wrapper{ 
    position:relative; 
    float:none; 
    .row(47); 
    &:after{ 
    content: ""; 
    display: table; 
    clear: both; 
    } 

} 
+0

请提供一些代码! – Bigood 2013-03-07 17:12:56

+0

对不起,编辑后显示代码 – 2013-03-07 18:02:17

回答

0

我会认为你会想这样的:

@total-width: @gridsystem-width; //leave this uncommented, to calculate width 
//@total-width: 100%; 
+0

感谢ScottS。这对我的嵌套列不起作用,它只是将它们堆叠在一起。我最终将总宽度设置为980,与最小宽度相同。 – 2013-03-08 14:02:16

+0

@MaureenDunlap:我考虑过这个建议,但不确定这是否能解决你所有的问题。从理论上讲,它似乎我要重新计算你的列数,列宽和沟的宽度,从而taht的'@ gridsystem-width' = 980,然后它计算出来。但是,如果只是将它编码为980为你工作,那就太好了。 – ScottS 2013-03-08 14:42:49