0
0
SASSmarkup~20 mins

Importing built-in modules with @use in SASS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Sass @use Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
2:00remaining
What is the output of this Sass code using @use?
Consider the following Sass code snippet:
@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%);
}
Acolor: #6699cc;
Bcolor: #336699;
Ccolor: #99bbee;
Dcolor: #99ccff;
Attempts:
2 left
💡 Hint
The color.scale function adjusts the lightness of the base color by the given percentage.
🧠 Conceptual
intermediate
1: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.
ABuilt-in modules must be imported with a namespace and cannot be imported without one.
BBuilt-in modules can be imported multiple times without any namespace conflicts.
CBuilt-in modules are automatically available without any import statement.
DBuilt-in modules can only be imported using @import, not @use.
Attempts:
2 left
💡 Hint
Think about how @use handles namespaces for modules.
selector
advanced
2: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: ???;
}
Awidth: math(10 / 2);
Bwidth: math.div(10, 2);
Cwidth: div(10, 2);
Dwidth: math.division(10, 2);
Attempts:
2 left
💡 Hint
Remember to use the namespace and exact function name.
layout
advanced
2:00remaining
What CSS does this Sass code produce when using @use with sass:list?
Analyze the following Sass code:
@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"), " ");
}
Agrid-template-columns: 1fr 2fr 1fr;
Bgrid-template-columns: ("1fr", "2fr", "1fr");
Cgrid-template-columns: 1fr, 2fr, 1fr;
Dgrid-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.
accessibility
expert
1:30remaining
What error occurs if you try to use a built-in Sass module function without @use?
Consider this Sass code:
.box {
  width: math.div(20, 4);
}

What happens if you do NOT include @use "sass:math"; at the top?
AError: Missing semicolon after math.div.
BThe code compiles and outputs width: 5;
CWarning: math.div is deprecated but still works.
DError: Undefined function "math.div".
Attempts:
2 left
💡 Hint
Think about how Sass knows where functions come from.