B. Using math.deg instead of math.rad to convert degrees to radians.
C. Cannot assign units like deg to variables.
D. Missing semicolon after $angle declaration.
Solution
Step 1: Understand math.deg and math.rad functions
math.deg() converts radians to degrees; math.rad() converts degrees to radians.
Step 2: Check code's intent and function used
The variable $angle is in degrees, but math.deg() is used, which expects radians. The correct function is math.rad().
Final Answer:
Using math.deg instead of math.rad to convert degrees to radians. -> Option B
Quick Check:
Degrees to radians = math.rad [OK]
Hint: Use math.rad for degrees to radians, math.deg for reverse [OK]
Common Mistakes:
Mixing up math.deg and math.rad functions
Thinking units like deg can't be assigned
Assuming missing semicolon causes error
5. You want to create a Sass variable $max-width that is the maximum of three values: 300px, 25rem, and 400px. Which code correctly uses sass:math to find this maximum, assuming 1rem = 16px?
hard
A. @use 'sass:math';
$max-width: math.max(300px, 25rem, 400px);
B. @use 'sass:math';
$max-width: math.max(300px, 400px, 25rem);
C. @use 'sass:math';
$max-width: math.max(300px, 25 * 16px, 400px);
D. @use 'sass:math';
$max-width: math.max(300px, math.div(25 * 16, 1), 400px);
Solution
Step 1: Understand unit conversion for comparison
To compare 25rem with px, convert 25rem to px: 25 * 16px = 400px.
Step 2: Use math.max with consistent units
@use 'sass:math';
$max-width: math.max(300px, 25 * 16px, 400px); converts 25rem to 400px by multiplying 25 * 16px, then finds max among 300px, 400px, 400px.