Challenge - 5 Problems
Typography Scale Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Understanding the base font size in a typography scale
In a Sass typography scale, what role does the base font size variable usually play?
Attempts:
2 left
💡 Hint
Think about what 'base' means in scaling something up or down.
✗ Incorrect
The base font size is the reference point for the entire scale. Other font sizes are calculated relative to it, ensuring consistent sizing.
📝 Syntax
intermediate2:00remaining
Correct Sass syntax for a modular scale function
Which Sass function correctly calculates a modular scale font size given a step and a ratio?
SASS
@function modular-scale($step, $base: 1rem, $ratio: 1.25) { @return $base * math.pow($ratio, $step); }
Attempts:
2 left
💡 Hint
Sass math functions require the math module and use math.pow for exponentiation.
✗ Incorrect
In modern Sass, math functions like pow are accessed via the math module, so math.pow($ratio, $step) is correct.
❓ rendering
advanced2:00remaining
Visual output of a typography scale with negative steps
Given this Sass code snippet, what font size will be applied to the class
.small-text?
@use 'sass:math';
$base-size: 1rem;
$ratio: 1.2;
@function modular-scale($step) {
@return $base-size * math.pow($ratio, $step);
}
.small-text {
font-size: modular-scale(-2);
}Attempts:
2 left
💡 Hint
Calculate 1rem * (1.2 ^ -2).
✗ Incorrect
Using the formula: 1rem * (1.2 ^ -2) = 1rem * (1 / 1.44) ≈ 0.694 rem.
❓ selector
advanced2:00remaining
Selecting headings with a typography scale in Sass
Which Sass selector correctly applies different modular scale font sizes to all heading levels
h1 through h6 using a loop?SASS
@use 'sass:math'; $base-size: 1rem; $ratio: 1.25; @function modular-scale($step) { @return $base-size * math.pow($ratio, $step); }
Attempts:
2 left
💡 Hint
Heading 1 is usually the largest, so it should have the highest step.
✗ Incorrect
Using @for from 1 to 6 and calculating 6 - $i assigns the largest font size to h1 and smaller sizes to higher heading numbers.
❓ accessibility
expert2:30remaining
Ensuring accessible typography scale with Sass
Which Sass approach best supports accessibility by maintaining readable font sizes across devices when using a modular scale?
Attempts:
2 left
💡 Hint
Think about how users zoom or change device sizes and how font sizes should adapt.
✗ Incorrect
Using rem units allows font sizes to scale with user settings. Adjusting the base size with media queries ensures readability on different devices, supporting accessibility.