Challenge - 5 Problems
Sass List 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 list operation?
Consider the following Sass code:
What is the value of
$list: 10px 20px 30px 40px;
$new-list: nth($list, 3);
What is the value of
$new-list?SASS
$list: 10px 20px 30px 40px; $new-list: nth($list, 3);
Attempts:
2 left
💡 Hint
Remember that
nth() returns the item at the given position starting from 1.✗ Incorrect
The
nth() function returns the element at the specified index. Here, index 3 corresponds to the third item, which is 30px.🧠 Conceptual
intermediate1:30remaining
How many items are in this Sass list?
Given the Sass list:
How many items does
$colors: red, green, blue, yellow;
How many items does
$colors contain?SASS
$colors: red, green, blue, yellow;Attempts:
2 left
💡 Hint
Count each color separated by commas.
✗ Incorrect
The list contains four colors separated by commas, so its length is 4.
❓ selector
advanced2:00remaining
Which option causes a syntax error in Sass list usage?
Which of the following Sass list declarations will cause a syntax error?
Attempts:
2 left
💡 Hint
Check how items are separated in Sass lists.
✗ Incorrect
Option A uses semicolons to separate items, which is invalid syntax for Sass lists. Lists use spaces or commas.
❓ layout
advanced2:00remaining
What is the output of this Sass list join operation?
Given:
What is the value of
$list1: 1 2 3;
$list2: 4 5 6;
$joined: join($list1, $list2, comma);
What is the value of
$joined?SASS
$list1: 1 2 3; $list2: 4 5 6; $joined: join($list1, $list2, comma);
Attempts:
2 left
💡 Hint
The
join() function combines lists with a separator you specify.✗ Incorrect
Using
comma as separator joins the two lists with a comma between them, preserving spaces inside each list.❓ accessibility
expert2:30remaining
Which Sass list operation helps improve accessibility by managing color contrast pairs?
You have a list of background colors and a list of text colors. Which Sass list operation is best to pair each background with a text color for accessibility checks?
Attempts:
2 left
💡 Hint
Think about pairing items from two lists into one list of pairs.
✗ Incorrect
The
zip() function combines two lists into a list of pairs, which is useful for pairing background and text colors for contrast checks.