使用 SASS/Susy 推拉

Push and Pull with SASS/Susy

我有一个三个 div 的布局,想将它们放在一行中:

主要|旁白 |盒子

main {@include span (8 of 17);
aside {@include span (4 at 9 of 17);
.box {@include span (2 at 13 of 17) @include pull(2);

我没有让 .box 将 space 放在它自己和旁边。使用上面的代码,.box 将被放置在 main 之上。没有

@include pull(2)

直接放在右边。有什么建议吗?

pull mixin 向元素添加 负左边距,将其拉到左侧。 push mixin 添加正的左边距,将其向右推。但在这种情况下,您可以将元素向右浮动,这就是添加 last 关键字时发生的情况。你想要做的是跨越 17 列中的最后 3 列,所以在这种情况下,你可以这样写:

.box { @include span(last 3 of 17); }

http://sassmeister.com/gist/c7c14a3ae4ef22d892a6