As I continue to enhance my front-end development skills and practice Sass to optimize my CSS code, I encountered a roadblock.
After exploring resources and tutorials online, I created a global mixin in Sass named 'transition'. Here is the code:
@mixin transition($args...) {
-moz-transition: $args;
-ms-transition: $args;
-o-transition: $args;
-webkit-transition: $args;
transition: $args;
}
Now, I want to specifically apply transition-delay for my span pseudo-elements (::before and ::after). The default CSS code looks like this:
span::before, span::after {
transition-delay: 0.5s, 0;
}
So here lies my question. Is it feasible to utilize my predefined mixin 'transition' to only pass transition-delay as arguments?
I attempted:
@include transition(delay: .5, 0s);
but this approach did not work. Despite searching through Sass documentation and various tutorials, I haven't had any luck finding a solution. I'm unsure of how to articulate my problem effectively to find the answer.
Could anyone kindly offer some guidance?