请看这个要点: http ://sassmeister.com/gist/6d575ec85663865fa567
在那里你可以看到一个 placehold.it 缩略图网格,通过float-span
我现在需要的是:
每行中第一个 .item 的 padding-left 应为 0
每行中最后一个 .item 的 padding-right 应为 0
然后,这将在缩略图网格中结束,与其余内容(例如 lorem ipsum 文本)完全对齐
用singularitygs实现这一目标的野兽方法是什么?
更新 2014-07-21
我需要的可以在这个屏幕上看到:
我不需要另一种填充样式,我需要删除每行中第一个和最后一个项目的填充。这不能通过 css 完成,因为 sass 计算是错误的。
更新 2014-07-30
基于各种来源,我设法建立了这个mixin:
@mixin thegrid($layout, $cols, $el: "div", $thegutter: .1){
@include layout($layout, $gutter: $thegutter) {
@for $i from 1 through $cols {
@if $i == 1 {
#{$el}:nth-child(#{$cols}n+#{$i}) {
@include isolation-span(1, $i, left);
}
}
@else if $i < $cols {
#{$el}:nth-child(#{$cols}n+#{$i}) {
@include isolation-span(1, $i, none);
}
}
@else {
#{$el}:nth-child(#{$cols}n+#{$i}) {
@include isolation-span(1, $i, right);
}
}
}
}
}
可以通过以下方式调用:
$layout: 1 1 1;
@include thegrid($layout, 3, $el: ".item");
一个例子可以在这里看到: http: //sassmeister.com/gist/7a45960747ad3d4bbf56