I need help creating a generic transition rule in Stylus. My current function is only working in specific cases, where it returns a string 'all ease-in-out 0.2s' instead of a proper CSS rule. This approach is not effective when trying to use it in a browser due to the single quotes.
Is there a way to update this function to return a pure CSS rule? Any assistance would be greatly appreciated.
getTransition(affect = 'all', animationRule = 'ease-in-out', time = 0.2)
return affect + " " + animationRule + " " + unit(time, 's')
Example usage:
transition: getTransition('opacity')
Expected result:
transition: 'opacity ease-in-out 0.2s';