susy-sass

determine last child in row using susy2


I'm using susy to create a responsive grid and I was wondering if I have a set of columns like:

<div class="container">
  <div class="col-4">Col 1</div>
  <div class="col-4">Col 2</div>
  <div class="col-4">Col 3</div>
</div>

how do I get susy to determine the last child?

I also noticed whenever I have this set up the margin-right causes them to be to wide for the container and they stack.

I tried to use last-flow: to, and it doesn't seem to be responding either.


Solution

  • Using the span mixin, you can specify first or last and Susy will remove the extra gutter where relevant (it depends on your "gutter-position" setting).

    All it really does is set margin-left or margin-right to 0, so of course there are lots of ways to deal with extra gutters depending on how you're using Susy. Without seeing your Sass and Susy config & usage, it's hard to say exactly what you should do.