@mixin position($pos: none, $off: none) {
    @if ($pos != none) {
        position: $pos#{$important};
    }

    @if ($off != none) {
        @if (length($off) >= 1) {
            @if (nth($off, 1) != none) {
                top: #{nth($off, 1)}#{$important};
            }
        }
        @if (length($off) >= 2) {
            @if (nth($off, 2) != none) {
                right: #{nth($off, 2)}#{$important};
            }
        }
        @if (length($off) >= 3) {
            @if (nth($off, 3) != none) {
                bottom: #{nth($off, 3)}#{$important};
            }
        }
        @if (length($off) >= 4) {
            @if (nth($off, 4) != none) {
                left: #{nth($off, 4)}#{$important};
            }
        }

        @if (length($off) >= 5) {
            @if (nth($off, 5) != none) {
                @include translateX(nth($off, 5), true);
            }
        }
        @if (length($off) >= 6) {
            @if (nth($off, 6) != none) {
                @include translateY(nth($off, 6), true);
            }
        }

        @if (length($off) >= 5) {
            @include transform;
        }
    }
}

// Absolute Alignment.
@mixin absolute($arg: none) {
    @include position(absolute, $arg);
}
@mixin absolute-left {
    @include absolute(none none none 0);
}
@mixin absolute-center {
    @include absolute(none none none 50% -50%);
}
@mixin absolute-right {
    @include absolute(none 0);
}

@mixin absolute-top {
    @include absolute(0);
}
@mixin absolute-middle {
    @include absolute(50% none none none none -50%);
}
@mixin absolute-bottom {
    @include absolute(none none 0);
}

@mixin absolute-top-left {
    @include absolute(0 none none 0);
}
@mixin absolute-top-center {
    @include absolute(0 none none 50% -50%);
}
@mixin absolute-top-right {
    @include absolute(0 0);
}

@mixin absolute-middle-left {
    @include absolute(50% none none 0 none -50%);
}
@mixin absolute-middle-center {
    @include absolute(50% none none 50% -50% -50%);
}
@mixin absolute-middle-right {
    @include absolute(50% 0 none none none -50%);
}

@mixin absolute-bottom-left {
    @include absolute(none none 0 0);
}
@mixin absolute-bottom-center {
    @include absolute(none none 0 50% -50%);
}
@mixin absolute-bottom-right {
    @include absolute(none 0 0);
}

// FIXED POSITIONS
@mixin fixed($arg: none) {
    @include position(fixed, $arg);
}
@mixin fixed-left {
    @include fixed(none none none 0);
}
@mixin fixed-center {
    @include fixed(none none none 50% -50%);
}
@mixin fixed-right {
    @include fixed(none 0);
}

@mixin fixed-top {
    @include fixed(0);
}
@mixin fixed-middle {
    @include fixed(50% none none none none -50%);
}
@mixin fixed-bottom {
    @include fixed(none none 0);
}

@mixin fixed-top-left {
    @include fixed(0 none none 0);
}
@mixin fixed-top-center {
    @include fixed(0 none none 50% -50%);
}
@mixin fixed-top-right {
    @include fixed(0 0);
}

@mixin fixed-middle-left {
    @include fixed(50% none none 0 none -50%);
}
@mixin fixed-middle-center {
    @include fixed(50% none none 50% -50% -50%);
}
@mixin fixed-middle-right {
    @include fixed(50% 0 none none none -50%);
}

@mixin fixed-bottom-left {
    @include fixed(none none 0 0);
}
@mixin fixed-bottom-center {
    @include fixed(none none 0 50% -50%);
}
@mixin fixed-bottom-right {
    @include fixed(none 0 0);
}

// RELATIVE POSITIONS
@mixin relative($arg: none) {
    @include position(relative, $arg);
}
@mixin relative-left {
    @include relative(none none none 0);
}
@mixin relative-center {
    @include relative(none none none 50% -50%);
}
@mixin relative-right {
    @include relative(none 0);
}

@mixin relative-top {
    @include relative(0);
}
@mixin relative-middle {
    @include relative(50% none none none none -50%);
}
@mixin relative-bottom {
    @include relative(none none 0);
}

@mixin relative-top-left {
    @include relative(0 none none 0);
}
@mixin relative-top-center {
    @include relative(0 none none 50% -50%);
}
@mixin relative-top-right {
    @include relative(0 0);
}

@mixin relative-middle-left {
    @include relative(50% none none 0 none -50%);
}
@mixin relative-middle-center {
    @include relative(50% none none 50% -50% -50%);
}
@mixin relative-middle-right {
    @include relative(50% 0 none none none -50%);
}

@mixin relative-bottom-left {
    @include relative(none none 0 0);
}
@mixin relative-bottom-center {
    @include relative(none none 0 50% -50%);
}
@mixin relative-bottom-right {
    @include relative(none 0 0);
}
