Recall & Review
beginner
What is a mixin in Sass?
A mixin in Sass is a reusable block of styles that you can include in other selectors. It helps avoid repeating code and keeps styles consistent.
Click to reveal answer
beginner
How do you define a simple animation mixin in Sass?
You define a mixin with
@mixin keyword, then include animation properties inside it. For example:<br>@mixin fadeIn($duration) {
animation-name: fadeIn;
animation-duration: $duration;
animation-fill-mode: forwards;
}Click to reveal answer
beginner
Why use animation mixins instead of writing animation CSS repeatedly?
Mixins save time and reduce mistakes by reusing animation code. They make it easy to change animation details in one place and keep your styles consistent.
Click to reveal answer
intermediate
What is the benefit of using parameters in animation mixins?
Parameters let you customize animations when you include the mixin. For example, you can change duration or delay without rewriting the whole animation code.Click to reveal answer
intermediate
How can you combine multiple animations in one mixin?
You can list multiple animations separated by commas inside the mixin. This lets you apply several animations at once with one mixin call.
Click to reveal answer
Which Sass directive is used to create a mixin?
✗ Incorrect
The
@mixin directive defines a mixin. @include is used to use a mixin.What does the
animation-fill-mode: forwards; property do in an animation?✗ Incorrect
The
forwards value keeps the element styled as it is at the end of the animation.How do you pass a duration of 2 seconds to a mixin named
fadeIn?✗ Incorrect
You use
@include with the mixin name and pass the argument in parentheses.Which of these is NOT a benefit of using animation mixins?
✗ Incorrect
Mixins help reuse code but do not automatically create keyframes; you must define keyframes separately.
How can you apply two animations,
slideIn and fadeOut, in one mixin?✗ Incorrect
You list multiple animation names separated by commas to apply them together.
Explain how to create and use an animation mixin in Sass with a customizable duration.
Think about how to write reusable code that accepts a time value.
You got /4 concepts.
Describe the advantages of using animation mixins in your CSS workflow.
Consider how mixins save time and reduce errors.
You got /4 concepts.