Recall & Review
beginner
What is a default parameter value in Sass?
A default parameter value is a value given to a function or mixin parameter that is used if no other value is provided when calling it.
Click to reveal answer
beginner
How do you set a default parameter value in a Sass mixin?
You assign the value in the parameter list using a colon, like
@mixin example($color: blue). If no color is passed, it uses blue.Click to reveal answer
beginner
What happens if you call a Sass function or mixin without providing a parameter that has a default value?
Sass uses the default value specified for that parameter automatically.
Click to reveal answer
intermediate
Can default parameter values in Sass be expressions or variables?
Yes, default values can be variables or expressions, like
$size: 10px * 2 or $color: $primary-color.Click to reveal answer
beginner
Why are default parameter values useful in Sass?
They let you write flexible mixins and functions that work with or without extra input, making your code easier to reuse and maintain.Click to reveal answer
How do you define a default parameter value in a Sass mixin?
✗ Incorrect
In Sass, default parameter values are set with a colon, for example
@mixin example($color: red).What value does a Sass mixin use if you don't provide a parameter with a default value?
✗ Incorrect
If no value is provided, Sass uses the default parameter value defined in the mixin or function.
Can default parameter values in Sass be variables?
✗ Incorrect
Sass allows variables to be used as default parameter values, making code flexible.
Which of these is a correct Sass mixin with a default parameter?
✗ Incorrect
Option B correctly sets a default parameter value using a colon.
Why use default parameter values in Sass?
✗ Incorrect
Default parameter values let your code work smoothly whether or not you provide extra input.
Explain how default parameter values work in Sass mixins and why they are helpful.
Think about how you can write mixins that don’t always need all inputs.
You got /4 concepts.
Describe a simple Sass mixin with a default parameter and what happens when you call it with and without that parameter.
Imagine a button color that changes if you give a color, or stays default if you don’t.
You got /3 concepts.