Mixins are created with @mixin but applied with @include.
Step 2: Identify incorrect usage
The code uses @mixin text-style; inside .title, which is wrong syntax.
Final Answer:
Using @mixin instead of @include inside .title -> Option C
Quick Check:
Apply mixins with @include, not @mixin [OK]
Hint: Use @include to apply mixins, never @mixin [OK]
Common Mistakes:
Confusing @mixin and @include
Adding dot before mixin name
Thinking mixins can't be used in selectors
5. You have a mixin library with multiple mixins for buttons. You want to create a new mixin primary-button that uses the existing button-base mixin and adds a blue background. Which Sass code correctly achieves this?
hard
A. @mixin primary-button { @include button-base; background-color: blue; }
B. @mixin primary-button { @mixin button-base; background-color: blue; }
C. @include primary-button { @include button-base; background-color: blue; }
D. @mixin primary-button { button-base(); background-color: blue; }
Solution
Step 1: Define new mixin with @mixin
Use @mixin primary-button { ... } to create the new mixin.
Step 2: Include existing mixin inside new one
Inside the new mixin, use @include button-base; to reuse styles.
Step 3: Add additional styles
Add background-color: blue; after including the base mixin.