Challenge - 5 Problems
Sass @use Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate2:00remaining
What is the output of this Sass code using @use?
Consider the following Sass code snippet:
What CSS color value will be generated for the
@use "sass:color";
.button {
color: color.scale(#6699cc, $lightness: 20%);
}What CSS color value will be generated for the
.button class?SASS
@use "sass:color"; .button { color: color.scale(#6699cc, $lightness: 20%); }
Attempts:
2 left
💡 Hint
The color.scale function adjusts the lightness of the base color by the given percentage.
✗ Incorrect
The base color #6699cc is lightened by 20%, resulting in a lighter blue shade #99bbee.
🧠 Conceptual
intermediate1:30remaining
Which statement about @use importing built-in Sass modules is true?
Select the correct statement about using the
@use rule to import built-in Sass modules like sass:math or sass:color.Attempts:
2 left
💡 Hint
Think about how @use handles namespaces for modules.
✗ Incorrect
When you import built-in modules with @use, you must use their namespace to access their functions or variables. This prevents naming conflicts.
❓ selector
advanced2:00remaining
Which option correctly uses a built-in Sass module function with @use?
Given the Sass code below, which option correctly uses the
math.div function from the built-in sass:math module to divide 10 by 2?SASS
@use "sass:math"; .result { width: ???; }
Attempts:
2 left
💡 Hint
Remember to use the namespace and exact function name.
✗ Incorrect
The correct syntax is to call the div function with the math namespace: math.div(10, 2).
❓ layout
advanced2:00remaining
What CSS does this Sass code produce when using @use with sass:list?
Analyze the following Sass code:
What is the resulting CSS for
@use "sass:list";
.container {
grid-template-columns: list.join(("1fr", "2fr", "1fr"), " ");
}What is the resulting CSS for
.container?SASS
@use "sass:list"; .container { grid-template-columns: list.join(("1fr", "2fr", "1fr"), " "); }
Attempts:
2 left
💡 Hint
The list.join function combines list items into a string separated by the given separator.
✗ Incorrect
list.join merges the list items into a single string separated by spaces, producing valid CSS grid columns.
❓ accessibility
expert1:30remaining
What error occurs if you try to use a built-in Sass module function without @use?
Consider this Sass code:
What happens if you do NOT include
.box {
width: math.div(20, 4);
}What happens if you do NOT include
@use "sass:math"; at the top?Attempts:
2 left
💡 Hint
Think about how Sass knows where functions come from.
✗ Incorrect
Without importing the sass:math module using @use, the math namespace and its functions are unknown, causing an undefined function error.