@function calculateWidth($cols, $margin) {
    @return ((100% - (($cols - 1)*$margin)) / $cols)
}

@mixin one-whole {
    width: 100%;
}

@mixin one-half {
    $margin: 2;

    width: calculateWidth(2, $margin);
    margin-right: $margin * 1%;

    &:nth-child(2n) {
        margin-right: 0;
    }
}

@mixin one-third {
    $margin: 4;

    width: calculateWidth(3, $margin);
    margin-right: $margin * 1%;

    &:nth-child(3n) {
        margin-right: 0;
    }
}

@mixin one-quarter {
    $margin: 2;

    width: calculateWidth(4, $margin);
    margin-right: $margin * 1%;

    &:nth-child(4n) {
        margin-right: 0;
    }
}

@mixin two-thirds {
    $margin: 4;

    $widthOfOneThird: calculateWidth(3, $margin);
    width: ($widthOfOneThird * 2) + $margin;
    margin-right: $margin * 1%;
}

Created by the handsome Jonathan Persson.