Home »
MCQs »
SASS MCQs
What is the correct syntax to define default values to mixin variables?
15. What is the correct syntax to define default values to mixin variables?
- @mixin mixin_name($variable: default_value, $variable: default_value) {properties: values/variables;}
- @mixin mixin_name($variable=default_value, $variable=default_value) {properties: values/variables;}
- @mixin mixin_name($variable-default_value, $variable-default_value) {properties: values/variables;}
- All of the above
Answer: A) @mixin mixin_name($variable: default_value, $variable: default_value) {properties: values/variables;}
Explanation:
The correct syntax to define default values to mixin variables is,
@mixin mixin_name($variable=default_value, $variable=default_value) {properties: values/variables;}
Example:
@mixin post($color: red, $width: 2px) {
border: $width solid $color;
}