I'm currently using this LESS mixin to define transitions on elements:
.transition(@property:left, @duration:0.4s, @delay:0s, @timing-function:cubic-bezier(.16,.53,.15,.99)) {
-webkit-transition:@property @duration @timing-function @delay;
-moz-transition:@property @duration @timing-function @delay;
-o-transition:@property @duration @timing-function @delay;
transition:@property @duration @timing-function @delay;
}
In many cases, the timing and easing can keep their default values, so I can simply do something like: .className { .transition(opacity); }
However, I'd like to use this same principle for animating multiple properties, without resulting to using "all". How would I be able to do that?
I've seen this post: Multiple properties are getting treated as separate arguments in mixins , but the solution here requires you to type all the arguments (duration and easing), which is not very practical, especially since I'm using a custom bezier for the easing.
So, basically what I want, is to create a mixin that I can use like this:
.transition(opacity .4s, transform .2s);
(Also on a sidenote wondering if there's a way to pass "transform" as a parameter, and get an output like -webkit-transition:-webkit-transform
and transition:transform
)