0
0
SASSmarkup~20 mins

Number types and units in SASS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Sass Number Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
2:00remaining
What is the output unit of this Sass calculation?
Consider the following Sass code snippet:
$width: 10px;
$height: 5em;
$area: $width * $height;

What is the unit of $area after this calculation?
SASS
$width: 10px;
$height: 5em;
$area: $width * $height;
Apx
Bem
Cunitless number
Dpxem
Attempts:
2 left
💡 Hint
Multiplying two numbers with different units combines their units in Sass.
🧠 Conceptual
intermediate
2:00remaining
Which Sass unit conversion is valid?
Given the Sass variables:
$length1: 2in;
$length2: 5cm;

Which operation will NOT cause an error in Sass?
SASS
$length1: 2in;
$length2: 5cm;
A$length1 * $length2
B$length1 / $length2
C$length1 + $length2
D$length1 - $length2
Attempts:
2 left
💡 Hint
Sass allows multiplication and division of numbers with different units but addition and subtraction require compatible units.
selector
advanced
2:00remaining
Which Sass code produces a unitless number?
Which of the following Sass expressions results in a unitless number?
A10px / 2px
B5em * 3
C4cm + 2cm
D8px - 3em
Attempts:
2 left
💡 Hint
Dividing two numbers with the same unit removes the units.
layout
advanced
2:00remaining
How does Sass handle incompatible units in addition?
What happens when you try to add these Sass variables?
$a: 10px;
$b: 2em;
$c: $a + $b;
SASS
$a: 10px;
$b: 2em;
$c: $a + $b;
A$c equals 10px + 2em as a string
BSass throws an error about incompatible units
C$c equals 10px2em (concatenated units)
D$c equals 12 (unitless)
Attempts:
2 left
💡 Hint
Sass requires units to be compatible for addition or subtraction.
accessibility
expert
2:00remaining
Which Sass unit usage best supports responsive and accessible design?
You want to set font sizes that scale well on different devices and respect user preferences.
Which unit should you use in Sass for font sizes to best support accessibility?
Apx (pixels)
Bcm (centimeters)
Cem (relative to parent font size)
Dpt (points)
Attempts:
2 left
💡 Hint
Relative units adapt better to user settings and screen sizes.