Skip to content

Instantly share code, notes, and snippets.

@ivcreative
Forked from fieldoffice/sass-transforms
Created June 23, 2019 21:34
Show Gist options
  • Save ivcreative/5fe04194c68129b8b540fe12eb83783d to your computer and use it in GitHub Desktop.
Save ivcreative/5fe04194c68129b8b540fe12eb83783d to your computer and use it in GitHub Desktop.
Sass Transform Mixins
// 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