Assuming $text-color is defined in _variables.scss but not imported.
medium
A. The .button selector is invalid without nesting.
B. Using @use instead of @import causes syntax error.
C. Variables cannot be shared between files in Sass.
D. Missing @use 'variables' in _buttons.scss causes undefined variable error.
Solution
Step 1: Identify variable scope in Sass modules
Variables must be imported with @use in each file that uses them; they are not global.
Step 2: Check the missing import in _buttons.scss
Since $text-color is defined in _variables.scss but not imported in _buttons.scss, it causes an undefined variable error.
Final Answer:
Missing @use 'variables' in _buttons.scss causes undefined variable error. -> Option D
Quick Check:
Variables need explicit @use in each file [OK]
Hint: Always @use variables in every file that needs them [OK]
Common Mistakes:
Assuming variables are global without import
Confusing @use and @import syntax errors
Thinking selectors need nesting to be valid
5. You want to split your Sass code into _variables.scss, _mixins.scss, and _buttons.scss. Which approach best improves maintainability and avoids duplication?
hard
A. Write all styles in one big file to avoid confusion.
B. Import all files directly in main.scss using @import for faster compilation.
C. Use @use 'variables' and @use 'mixins' inside _buttons.scss, then @use 'buttons' in main.scss.
D. Use @include to add variables and mixins inside _buttons.scss.
Solution
Step 1: Understand modular Sass with @use
Each partial file should import its dependencies with @use to keep scope clear and avoid duplication.
Step 2: Structure imports for maintainability
_buttons.scss uses variables and mixins, so it should @use both. Then main.scss only needs to @use buttons.
Final Answer:
Use @use 'variables' and @use 'mixins' inside _buttons.scss, then @use 'buttons' in main.scss. -> Option C
Quick Check:
Modular @use inside partials = best maintainability [OK]
Hint: Let partials @use their needs; main imports only top-level [OK]
Common Mistakes:
Using deprecated @import instead of @use
Putting all code in one file
Misusing @include for file imports
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.