-
-
Save ivcreative/5fe04194c68129b8b540fe12eb83783d to your computer and use it in GitHub Desktop.
Sass Transform Mixins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Browser Prefixes | |
@mixin transform($transforms) { | |
-webkit-transform: $transforms; | |
-moz-transform: $transforms; | |
-ms-transform: $transforms; | |
transform: $transforms; | |
} | |
// Rotate | |
@mixin rotate ($deg) { | |
@include transform(rotate(#{$deg}deg)); | |
} | |
// Scale | |
@mixin scale($scale) { | |
@include transform(scale($scale)); | |
} | |
// Translate | |
@mixin translate ($x, $y) { | |
@include transform(translate($x, $y)); | |
} | |
// Skew | |
@mixin skew ($x, $y) { | |
@include transform(skew(#{$x}deg, #{$y}deg)); | |
} | |
// Transform Origin | |
@mixin transform-origin ($origin) { | |
-webkit-transform-origin: $origin; | |
-moz-transform-origin: $origin; | |
-ms-transform-origin: $origin; | |
transform-origin: $origin; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment