0
0
SASSmarkup~20 mins

List values and operations in SASS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Sass List 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 list operation?
Consider the following Sass code:
$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);
A40px
B10px
C20px
D30px
Attempts:
2 left
💡 Hint
Remember that nth() returns the item at the given position starting from 1.
🧠 Conceptual
intermediate
1:30remaining
How many items are in this Sass list?
Given the Sass list:
$colors: red, green, blue, yellow;

How many items does $colors contain?
SASS
$colors: red, green, blue, yellow;
A5
B1
C4
D3
Attempts:
2 left
💡 Hint
Count each color separated by commas.
selector
advanced
2:00remaining
Which option causes a syntax error in Sass list usage?
Which of the following Sass list declarations will cause a syntax error?
A$list: 10px; 20px; 30px;
B$list: (10px 20px 30px);
C$list: 10px 20px 30px;
D$list: 10px, 20px, 30px;
Attempts:
2 left
💡 Hint
Check how items are separated in Sass lists.
layout
advanced
2:00remaining
What is the output of this Sass list join operation?
Given:
$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);
A1 2 3,4 5 6
B1,2,3,4,5,6
C1,2,3 4,5,6
D1 2 3 4 5 6
Attempts:
2 left
💡 Hint
The join() function combines lists with a separator you specify.
accessibility
expert
2: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?
Aappend() to add text colors to background colors list
Bzip() to combine background and text color lists into pairs
Clength() to count how many colors are in each list
Dnth() to select the first color from each list separately
Attempts:
2 left
💡 Hint
Think about pairing items from two lists into one list of pairs.