@mixin transform($val: null) {
    -webkit-transform: $val;
    -moz-transform: $val;
    -ms-transform: $val;
    -o-transform: $val;
    transform: $val;
}

@mixin translate($x: null, $y: null) {
    @if ($x != null and $y != null) {
        -webkit-transform: translate($x, $y);
        -moz-transform: translate($x, $y);
        -ms-transform: translate($x, $y);
        -o-transform: translate($x, $y);
        transform: translate($x, $y);
    }
}

@mixin translate3d($x: null, $y: null, $z: null) {
    @if ($x != null and $y != null and $z != null) {
        -webkit-transform: translate3d($x, $y, $z);
        -moz-transform: translate3d($x, $y);
        -ms-transform: translate3d($x, $y, $z);
        -o-transform: translate3d($x, $y, $z);
        transform: translate3d($x, $y, $z);
    }
}

@mixin translateX($x) {
    @if ($x != null) {
        -webkit-transform: translateX($x);
        -moz-transform: translateX($x);
        -ms-transform: translateX($x);
        -o-transform: translateX($x);
        transform: translateX($x);
    }
}

@mixin translateY($y) {
    @if ($y != null) {
        -webkit-transform: translateX($y);
        -moz-transform: translateX($y);
        -ms-transform: translateX($y);
        -o-transform: translateX($y);
        transform: translateX($y);
    }
}

@mixin translateZ($z) {
    @if ($z != null) {
        -webkit-transform: translateZ($z);
        -moz-transform: translateZ($z);
        -ms-transform: translateZ($z);
        -o-transform: translateZ($z);
        transform: translateZ($z);
    }
}

@mixin rotate($val: null) {
    @if ($val != null) {
        -webkit-transform: rotate($val);
        -moz-transform: rotate($val);
        -ms-transform: rotate($val);
        -o-transform: rotate($val);
        transform: rotate($val);
    }
}

@mixin rotate3d($x: null, $y: null, $z: null, $val: null) {
    @if ($x != null and $y != null and $z != null and $val != null) {
        -webkit-transform: rotate3d($x, $y, $z, $val);
        -moz-transform: rotate3d($x, $y, $z, $val);
        -ms-transform: rotate3d($x, $y, $z, $val);
        -o-transform: rotate3d($x, $y, $z, $val);
        transform: rotate3d($x, $y, $z, $val);
    }
}

@mixin rotateX($x: null) {
    @if ($x != null) {
        -webkit-transform: rotateX($x);
        -moz-transform: rotateX($x);
        -ms-transform: rotateX($x);
        -o-transform: rotateX($x);
        transform: rotateX($x);
    }
}

@mixin rotateY($y: null) {
    @if ($y != null) {
        -webkit-transform: rotateY($y);
        -moz-transform: rotateY($y);
        -ms-transform: rotateY($y);
        -o-transform: rotateY($y);
        transform: rotateY($y);
    }
}

@mixin rotateZ($z: null) {
    @if ($z != null) {
        -webkit-transform: rotateZ($z);
        -moz-transform: rotateZ($z);
        -ms-transform: rotateZ($z);
        -o-transform: rotateZ($z);
        transform: rotateZ($z);
    }
}

@mixin scale($val: null) {
    @if ($val != null) {
        -webkit-transform: scale($val);
        -moz-transform: scale($val);
        -ms-transform: scale($val);
        -o-transform: scale($val);
        transform: scale($val);
    }
}

@mixin scale3d($x: null, $y: null, $z: null) {
    @if ($x != null and $y != null and $z != null) {
        -webkit-transform: scale3d($x, $y, $z);
        -moz-transform: scale3d($x, $y, $z);
        -ms-transform: scale3d($x, $y, $z);
        -o-transform: scale3d($x, $y, $z);
        transform: scale3d($x, $y, $z);
    }
}

@mixin scaleX($x: null) {
    @if ($x != null) {
        -webkit-transform: scaleX($x);
        -moz-transform: scaleX($x);
        -ms-transform: scaleX($x);
        -o-transform: scaleX($x);
        transform: scaleX($x);
    }
}

@mixin scaleY($y: null) {
    @if ($y != null) {
        -webkit-transform: scaleY($y);
        -moz-transform: scaleY($y);
        -ms-transform: scaleY($y);
        -o-transform: scaleY($y);
        transform: scaleY($y);
    }
}

@mixin scaleZ($z: null) {
    @if ($z != null) {
        -webkit-transform: scaleZ($z);
        -moz-transform: scaleZ($z);
        -ms-transform: scaleZ($z);
        -o-transform: scaleZ($z);
        transform: scaleZ($z);
    }
}

@mixin skew($x: null, $y: null) {
    @if ($x != null and $y != null) {
        -webkit-transform: skew($x, $y);
        transform: skew($x, $y);
    }
}

@mixin skewX($x: null) {
    @if ($x != null) {
        -webkit-transform: skewX($x);
        transform: skew($x);
    }
}

@mixin skewY($y: null) {
    @if ($y != null) {
        -webkit-transform: skewY($y);
        -moz-transform: skewY($y);
        -ms-transform: skewY($y);
        -o-transform: skewY($y);
        transform: skew($y);
    }
}

@mixin matrix($matrix...) {
    -webkit-transform: matrix($matrix);
    -moz-transform: matrix($matrix);
    -ms-transform: matrix($matrix);
    -o-transform: matrix($matrix);
    transform: matrix($matrix);
}
