Transition Mixin with multiple vendor prefixes
This Mixin takes advantage of Sass's each loop to cover multiple vendor prefixes and make it easier to include transitions with a single include. It was written to be clean and small. Enjoy
@mixin transition($transition...) {
$prefixes: ("-webkit", "-ms", "-o", "");
@each $prefix in $prefixes {
#{$prefix}-transition: $transition;
}
transition: $transition;
}
// Usage:</p>
```
element {
@include transition(all 0.2s ease-in-out);
}
```
Written by John Kilpatrick
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Scss
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#