Challenge - 5 Problems
Breakpoint Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Understanding breakpoint maps in Sass
Given the following Sass map for breakpoints, what is the value of
$breakpoints["tablet"]?SASS
$breakpoints: ( "mobile": 320px, "tablet": 768px, "desktop": 1024px );
Attempts:
2 left
💡 Hint
Look at the key named "tablet" in the map.
✗ Incorrect
In Sass maps, you access values by their keys. The key "tablet" corresponds to 768px.
📝 Syntax
intermediate2:00remaining
Correct syntax for defining breakpoint variables
Which of the following Sass code snippets correctly defines a map named
$breakpoints with keys "small" and "large" and values 480px and 1200px respectively?Attempts:
2 left
💡 Hint
Sass maps use parentheses and colons for key-value pairs.
✗ Incorrect
Sass maps are defined with parentheses and key-value pairs separated by colons. Option C uses correct syntax.
❓ selector
advanced2:00remaining
Using breakpoint maps in media queries
Given the breakpoint map below, which Sass code correctly applies styles only for screens wider than the "desktop" breakpoint?
SASS
$breakpoints: ( "mobile": 320px, "tablet": 768px, "desktop": 1024px );
Attempts:
2 left
💡 Hint
Use the Sass function to get values from maps.
✗ Incorrect
The correct way to get a value from a Sass map is using map-get(map, key). Option B uses this correctly.
❓ layout
advanced2:00remaining
Responsive layout with breakpoint variables
You want a container to have 100% width on mobile and tablet, but max-width 1200px on desktop and larger. Which Sass code using breakpoint variables achieves this?
SASS
$breakpoints: ( "mobile": 320px, "tablet": 768px, "desktop": 1024px );
Attempts:
2 left
💡 Hint
Use min-width media query for desktop and larger.
✗ Incorrect
Option D sets width 100% by default and applies max-width 1200px only when screen is at least desktop size.
❓ accessibility
expert3:00remaining
Ensuring accessible font scaling with breakpoint maps
You have a Sass map of breakpoints and want to scale font sizes responsively for accessibility. Which approach below correctly uses breakpoint maps and relative units to improve accessibility?
SASS
$breakpoints: ( "mobile": 320px, "tablet": 768px, "desktop": 1024px );
Attempts:
2 left
💡 Hint
Use relative units like rem for better accessibility.
✗ Incorrect
Option A uses rem units and increases font size at larger breakpoints, which respects user settings and improves accessibility.